Fix persistence pause behavior

This commit is contained in:
Igor Katson 2024-08-23 17:47:28 +01:00
parent eb2b9e5a41
commit 6823490803
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
3 changed files with 10 additions and 3 deletions

View file

@ -8,7 +8,6 @@ use crate::{
storage::filesystem::FilesystemStorageFactory,
torrent_state::ManagedTorrentHandle,
type_aliases::BF,
ManagedTorrentState,
};
use anyhow::{bail, Context};
use async_trait::async_trait;
@ -146,7 +145,7 @@ impl JsonSessionPersistenceStore {
// we don't serialize this here, but to a file instead.
torrent_bytes: Default::default(),
only_files: torrent.only_files().clone(),
is_paused: torrent.with_state(|s| matches!(s, ManagedTorrentState::Paused(_))),
is_paused: torrent.is_paused(),
output_folder: torrent.shared().options.output_folder.clone(),
};