aboutsummaryrefslogtreecommitdiff
path: root/import
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-04-15 17:13:15 +0200
committermetamuffin <metamuffin@disroot.org>2024-04-15 17:13:15 +0200
commit29a62d702b24d8ea30c72e17569d9a98ad2775b9 (patch)
tree0f3f746054d7d52cb537c055217e8afe88f68baf /import
parent2c1b50a1f32c5f87489c2bc03f81e53da8cf3d29 (diff)
downloadjellything-29a62d702b24d8ea30c72e17569d9a98ad2775b9.tar
jellything-29a62d702b24d8ea30c72e17569d9a98ad2775b9.tar.bz2
jellything-29a62d702b24d8ea30c72e17569d9a98ad2775b9.tar.zst
upgrade all deps (except image-rs)
Diffstat (limited to 'import')
-rw-r--r--import/Cargo.toml16
-rw-r--r--import/src/db.rs9
-rw-r--r--import/src/lib.rs10
3 files changed, 18 insertions, 17 deletions
diff --git a/import/Cargo.toml b/import/Cargo.toml
index 9ef517b..8844812 100644
--- a/import/Cargo.toml
+++ b/import/Cargo.toml
@@ -11,18 +11,18 @@ jellymatroska = { path = "../matroska" }
jellyremuxer = { path = "../remuxer" }
log = { workspace = true }
-anyhow = "1.0.75"
+anyhow = "1.0.82"
reqwest = { workspace = true }
urlencoding = "2.1.3"
bincode = { version = "2.0.0-rc.3", features = ["derive"] }
-serde = { version = "1.0.193", features = ["derive"] }
-serde_json = "1.0.108"
-serde_yaml = "0.9.27"
+serde = { version = "1.0.197", features = ["derive"] }
+serde_json = "1.0.115"
+serde_yaml = "0.9.34"
-async-recursion = "1.0.5"
-futures = "0.3.29"
+async-recursion = "1.1.0"
+futures = "0.3.30"
tokio = { workspace = true }
-regex = "1.10.2"
-base64 = "0.21.7"
+regex = "1.10.4"
+base64 = "0.22.0"
diff --git a/import/src/db.rs b/import/src/db.rs
index c667cf5..39b5b3e 100644
--- a/import/src/db.rs
+++ b/import/src/db.rs
@@ -1,7 +1,8 @@
use anyhow::{anyhow, Context};
use jellybase::database::{
+ redb::ReadableTable,
tantivy::{doc, DateTime},
- DataAcid, ReadableTable, Ser, T_NODE, T_NODE_EXTENDED, T_NODE_IMPORT,
+ DataAcid, Ser, T_NODE, T_NODE_EXTENDED, T_NODE_IMPORT,
};
use jellycommon::{ExtendedNode, Node};
use log::info;
@@ -37,7 +38,7 @@ impl ImportStorage for DatabaseStorage<'_> {
info!("removing old nodes...");
let txn = self.db.inner.begin_write()?;
let mut table = txn.open_table(T_NODE)?;
- table.drain::<&str>(..)?;
+ table.retain(|_, _| false)?;
drop(table);
txn.commit()?;
Ok(())
@@ -84,7 +85,7 @@ impl ImportStorage for DatabaseStorage<'_> {
info!("clearing temporary node tree...");
let txn = self.db.inner.begin_write()?;
let mut table = txn.open_table(T_NODE_IMPORT)?;
- table.drain::<&str>(..)?;
+ table.retain(|_, _| false)?;
drop(table);
txn.commit()?;
@@ -110,7 +111,7 @@ impl ImportStorage for MemoryStorage<'_> {
info!("removing old nodes...");
let txn = self.db.inner.begin_write()?;
let mut table = txn.open_table(T_NODE)?;
- table.drain::<&str>(..)?;
+ table.retain(|_, _| false)?;
drop(table);
txn.commit()?;
self.db
diff --git a/import/src/lib.rs b/import/src/lib.rs
index 40648d0..3adfd85 100644
--- a/import/src/lib.rs
+++ b/import/src/lib.rs
@@ -17,13 +17,13 @@ use futures::{stream::FuturesUnordered, StreamExt};
use jellybase::{
assetfed::AssetInner,
cache::{async_cache_file, cache_memory},
- database::{DataAcid, ReadableTable, T_NODE_IMPORT},
+ database::{redb::ReadableTableMetadata, DataAcid, T_NODE_IMPORT},
federation::Federation,
CONF, SECRETS,
};
use jellyclient::Session;
use jellycommon::{
- chrono::{Datelike, NaiveDateTime},
+ chrono::{DateTime, Datelike},
Asset, ExtendedNode, ImportOptions, ImportSource, MediaInfo, Node, NodeKind, NodePrivate,
NodePublic, PeopleGroup, Rating, SourceTrack, TmdbKind, TrackSource, TraktKind,
};
@@ -64,7 +64,7 @@ pub async fn import(db: &DataAcid, fed: &Federation) -> anyhow::Result<()> {
let mut table = txn.open_table(T_NODE_IMPORT)?;
if !table.is_empty()? {
info!("clearing temporary node tree from an aborted last import...");
- table.drain::<&str>(..)?;
+ table.retain(|_, _| false)?;
}
drop(table);
txn.commit()?;
@@ -145,9 +145,9 @@ fn generate_node_paths(db: &impl ImportStorage) -> anyhow::Result<()> {
NodeKind::Movie => node.public.release_date.map(|date| {
format!(
"{}",
- NaiveDateTime::from_timestamp_millis(date)
+ DateTime::from_timestamp_millis(date)
.unwrap()
- .date()
+ .date_naive()
.year()
)
}),