diff options
Diffstat (limited to 'import')
-rw-r--r-- | import/src/lib.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/import/src/lib.rs b/import/src/lib.rs index f804871..ff687d7 100644 --- a/import/src/lib.rs +++ b/import/src/lib.rs @@ -42,6 +42,10 @@ static IMPORT_SEM: LazyLock<Semaphore> = LazyLock::new(|| Semaphore::new(1)); pub async fn import(db: &Database, fed: &Federation) -> anyhow::Result<()> { let permit = IMPORT_SEM.try_acquire()?; + if !db.node_import.is_empty() { + info!("clearing temporary node tree from an aborted last import..."); + db.node_import.clear()?; + } info!("loading sources..."); import_path(CONF.library_path.clone(), vec![], db, fed) .await @@ -277,7 +281,7 @@ async fn process_source( if let Some((filename, data)) = metadata.cover { node.private.poster = Some( async_cache_file( - &[media_path.to_str().unwrap(), &filename], + &["att-cover", media_path.to_str().unwrap(), &filename], |mut f| async move { f.write_all(&data).await?; Ok(()) |