diff options
Diffstat (limited to 'import/src/lib.rs')
-rw-r--r-- | import/src/lib.rs | 10 |
1 files changed, 5 insertions, 5 deletions
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() ) }), |