It compiles now

This commit is contained in:
Igor Katson 2024-04-30 09:02:18 +01:00
parent 42bbf84ea5
commit 67c22c9313
4 changed files with 22 additions and 8 deletions

View file

@ -96,8 +96,11 @@ impl SessionDatabase {
torrents: self
.torrents
.iter()
.map(|(id, torrent)| {
(
.filter_map(|(id, torrent)| {
// This will skip serializing torrents that don't have an output folder.
// This is for backwards compat not to change serialization format.
let output_folder = torrent.storage_factory.output_folder()?;
Some((
*id,
SerializedTorrent {
trackers: torrent
@ -111,9 +114,9 @@ impl SessionDatabase {
only_files: torrent.only_files().clone(),
is_paused: torrent
.with_state(|s| matches!(s, ManagedTorrentState::Paused(_))),
output_folder: torrent.info().out_dir.clone(),
output_folder: output_folder.to_owned(),
},
)
))
})
.collect(),
}