Fix only files not working properly (#59)

* 1/n fixing only files - tracking stats better

* 2/n proper tracking of stats when only certain files selected
This commit is contained in:
Igor Katson 2023-12-14 11:58:09 +00:00 committed by GitHub
parent 50fc7f2f01
commit 325855ba56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 91 additions and 46 deletions

View file

@ -86,9 +86,10 @@ impl TorrentStateInitializing {
})?;
info!(
"Initial check results: have {}, needed {}",
"Initial check results: have {}, needed {}, total selected {}",
SF::new(initial_check_results.have_bytes),
SF::new(initial_check_results.needed_bytes)
SF::new(initial_check_results.needed_bytes),
SF::new(initial_check_results.total_selected_bytes)
);
self.meta.spawner.spawn_block_in_place(|| {
@ -126,6 +127,7 @@ impl TorrentStateInitializing {
initial_check_results.needed_pieces,
initial_check_results.have_pieces,
self.meta.lengths,
initial_check_results.total_selected_bytes,
);
let paused = TorrentStatePaused {
@ -134,6 +136,7 @@ impl TorrentStateInitializing {
filenames,
chunk_tracker,
have_bytes: initial_check_results.have_bytes,
needed_bytes: initial_check_results.needed_bytes,
};
Ok(paused)
}