mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-15 01:33:07 -07:00
- Fixes for share ratio calculation
This commit is contained in:
parent
968c3e1c3e
commit
da11488ba1
4 changed files with 12 additions and 7 deletions
|
@ -763,14 +763,12 @@ 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) {
|
||||
if(h.all_time_upload() == 0)
|
||||
return 1.;
|
||||
return 10.;
|
||||
return 101;
|
||||
}
|
||||
float ratio = (float)h.all_time_upload()/(float)h.all_time_download();
|
||||
Q_ASSERT(ratio >= 0.);
|
||||
if(ratio > 10.)
|
||||
ratio = 10.;
|
||||
if(ratio > 100.)
|
||||
ratio = 100.;
|
||||
return ratio;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue