Skip to content

Commit

Permalink
Merge pull request #8 from pcmid/pcmid/fix/wrong_result_for_mbps
Browse files Browse the repository at this point in the history
Fix: multiply the number of bytes by 8
  • Loading branch information
ikatson authored Oct 25, 2021
2 parents 921fc81 + 1871351 commit 81cf94b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions crates/librqbit/src/http_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ impl Speed {
fn new(mbps: f64) -> Self {
Self {
mbps,
human_readable: format!("{:.2}Mbps", mbps),
human_readable: format!("{:.2} MiB/s", mbps),
}
}
}
Expand Down Expand Up @@ -355,7 +355,7 @@ impl HttpApi {
return Ok::<_, warp::Rejection>(make_response(
400,
"invalid utf-8".into(),
))
));
}
};
let opts = AddTorrentOptions {
Expand Down
2 changes: 1 addition & 1 deletion crates/rqbit/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ async fn async_main(opts: Opts, spawner: BlockingSpawner) -> anyhow::Result<()>
(progress as f64 / total as f64) * 100f64
};
info!(
"[{}]: {:.2}% ({:.2}), down speed {:.2} Mbps, fetched {}, remaining {:.2} of {:.2}, uploaded {:.2}, peers: {{live: {}, connecting: {}, queued: {}, seen: {}}}",
"[{}]: {:.2}% ({:.2}), down speed {:.2} MiB/s, fetched {}, remaining {:.2} of {:.2}, uploaded {:.2}, peers: {{live: {}, connecting: {}, queued: {}, seen: {}}}",
idx,
downloaded_pct,
SF::new(progress),
Expand Down

0 comments on commit 81cf94b

Please sign in to comment.