Folders and files are now deleted more comprehensively

This commit is contained in:
Igor Katson 2024-06-21 13:18:30 +01:00
parent 7147f16042
commit ace4bed0c6
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
13 changed files with 253 additions and 103 deletions

View file

@ -275,7 +275,7 @@ impl ManagedTorrent {
error_span!(parent: span.clone(), "initialize_and_start"),
token.clone(),
async move {
match init.check(&t.storage_factory).await {
match init.check().await {
Ok(paused) => {
let mut g = t.locked.write();
if let ManagedTorrentState::Initializing(_) = &g.state {
@ -325,6 +325,7 @@ impl ManagedTorrent {
let initializing = Arc::new(TorrentStateInitializing::new(
self.info.clone(),
g.only_files.clone(),
self.storage_factory.create_and_init(self.info())?,
));
g.state = ManagedTorrentState::Initializing(initializing.clone());
self.state_change_notify.notify_waiters();
@ -616,6 +617,7 @@ impl ManagedTorrentBuilder {
let initializing = Arc::new(TorrentStateInitializing::new(
info.clone(),
self.only_files.clone(),
self.storage_factory.create_and_init(&info)?,
));
Ok(Arc::new(ManagedTorrent {
locked: RwLock::new(ManagedTorrentLocked {