remove torrent from session only if the enable_upload config option disabled

This commit is contained in:
yggverse 2025-08-08 21:53:52 +03:00
parent bae3febced
commit 1c631c23da

View file

@ -190,10 +190,12 @@ async fn main() -> Result<()> {
keep_files.len() keep_files.len()
); );
preload.commit(&i, bytes, Some(keep_files))?; preload.commit(&i, bytes, Some(keep_files))?;
// remove torrent from session as indexed // remove torrent from the session as indexed
if !config.enable_upload {
session session
.delete(librqbit::api::TorrentIdOrHash::Id(id), false) .delete(librqbit::api::TorrentIdOrHash::Id(id), false)
.await?; .await?;
}
log::debug!("torrent `{i}` resolved.") log::debug!("torrent `{i}` resolved.")
} }
Ok(_) => panic!(), Ok(_) => panic!(),