Well, it doesnt crash at least

This commit is contained in:
Igor Katson 2024-03-30 17:55:43 +00:00
parent 276a1e175e
commit efcffdd072
6 changed files with 101 additions and 21 deletions

View file

@ -107,7 +107,7 @@ impl SessionDatabase {
.collect(),
info_hash: torrent.info_hash().as_string(),
info: torrent.info().info.clone(),
only_files: torrent.only_files.clone(),
only_files: torrent.only_files().clone(),
is_paused: torrent
.with_state(|s| matches!(s, ManagedTorrentState::Paused(_))),
output_folder: torrent.info().out_dir.clone(),
@ -1137,6 +1137,18 @@ impl Session {
Ok(())
}
pub fn update_only_files(
self: &Arc<Self>,
handle: &ManagedTorrentHandle,
only_files: &HashSet<usize>,
) -> anyhow::Result<()> {
let need_to_unpause = handle.update_only_files(only_files)?;
if need_to_unpause {
self.unpause(handle)?;
}
Ok(())
}
pub fn tcp_listen_port(&self) -> Option<u16> {
self.tcp_listen_port
}