This commit is contained in:
Igor Katson 2021-06-27 08:44:25 +01:00
parent 5c5cf3c24a
commit 7fc41fd953
2 changed files with 3 additions and 14 deletions

View file

@ -1225,18 +1225,7 @@ impl TorrentManager {
}
Ok(response.interval)
}
fn get_total(&self) -> u64 {
if let Some(length) = self.inner.torrent.info.length {
return length;
}
self.inner
.torrent
.info
.files
.as_ref()
.map(|files| files.iter().map(|f| f.length).sum())
.unwrap_or_default()
}
fn get_left_to_download(&self) -> u64 {
self.inner.needed - self.get_downloaded()
}