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
1 changed files with 9 additions and 1 deletions

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
{