mirror of
https://github.com/transmission/transmission
synced 2025-03-09 13:50:00 +00:00
if seeding without ever downloading with T, calculate ratio by using the file size as amount downloaded
This commit is contained in:
parent
7b78590acf
commit
dbc1e1619e
1 changed files with 9 additions and 1 deletions
|
@ -461,7 +461,15 @@ tr_stat_t * tr_torrentStat( tr_torrent_t * tor )
|
|||
|
||||
if( s->downloaded == 0 )
|
||||
{
|
||||
s->ratio = s->uploaded == 0 ? TR_RATIO_NA : TR_RATIO_INF;
|
||||
//if seeding without ever downloading, calculate ratio from total size
|
||||
if( s->progress >= 1.0 )
|
||||
{
|
||||
s->ratio = (float)s->uploaded / (float)inf->totalSize;
|
||||
}
|
||||
else
|
||||
{
|
||||
s->ratio = s->uploaded == 0 ? TR_RATIO_NA : TR_RATIO_INF;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue