mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 15:37:26 -06:00
- Display a ratio of 0.0 if total_upload and total_download are both 0
This commit is contained in:
@@ -775,7 +775,9 @@ float bittorrent::getRealRatio(QString hash) const{
|
||||
Q_ASSERT(h.all_time_download() >= 0);
|
||||
Q_ASSERT(h.all_time_upload() >= 0);
|
||||
if(h.all_time_download() == 0) {
|
||||
return 101;
|
||||
if(h.all_time_upload() == 0)
|
||||
return 0;
|
||||
return 101;
|
||||
}
|
||||
float ratio = (float)h.all_time_upload()/(float)h.all_time_download();
|
||||
Q_ASSERT(ratio >= 0.);
|
||||
|
||||
Reference in New Issue
Block a user