1
0
Fork 0
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:
Mitchell Livingston 2007-04-20 23:31:49 +00:00
parent 7b78590acf
commit dbc1e1619e

View file

@ -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
{