Changeset 1766


Ignore:
Timestamp:
Apr 20, 2007, 11:31:49 PM (15 years ago)
Author:
livings124
Message:

if seeding without ever downloading with T, calculate ratio by using the file size as amount downloaded

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/torrent.c

    r1655 r1766  
    462462    if( s->downloaded == 0 )
    463463    {
    464         s->ratio = s->uploaded == 0 ? TR_RATIO_NA : TR_RATIO_INF;
     464        //if seeding without ever downloading, calculate ratio from total size
     465        if( s->progress >= 1.0 )
     466        {
     467            s->ratio = (float)s->uploaded / (float)inf->totalSize;
     468        }
     469        else
     470        {
     471            s->ratio = s->uploaded == 0 ? TR_RATIO_NA : TR_RATIO_INF;
     472        }
    465473    }
    466474    else
Note: See TracChangeset for help on using the changeset viewer.