Changeset 9404


Ignore:
Timestamp:
Oct 25, 2009, 6:49:20 PM (13 years ago)
Author:
livings124
Message:

on second thought, the other UI's might want this value sooner or later, and it's cheaper to calculate it in the stat function

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/torrent.c

    r9403 r9404  
    10241024            break;
    10251025    }
     1026   
     1027    if( !checkSeedRatio || s->ratio >= seedRatio || s->ratio == TR_RATIO_INF )
     1028        s->percentRatio = 1.0;
     1029    else if( s->ratio == TR_RATIO_NA )
     1030        s->percentRatio = 0.0;
     1031    else
     1032        s->percentRatio = s->ratio / seedRatio;
    10261033
    10271034    tr_torrentUnlock( tor );
  • trunk/libtransmission/transmission.h

    r9403 r9404  
    16291629    float    percentDone;
    16301630
     1631    /** The percentage of the actual ratio to the seed ratio.  This will be
     1632        equal to 1 if the ratio is reached or the torrent is set to seed forever.
     1633        Range is [0..1] */
     1634    float    percentRatio;
     1635
    16311636    /** Speed all data being sent for this torrent. (KiB/s)
    16321637        This includes piece data, protocol messages, and TCP overhead */
  • trunk/macosx/Torrent.m

    r9403 r9404  
    344344- (CGFloat) progressStopRatio
    345345{
    346     double seedRatio;
    347     if (!tr_torrentGetSeedRatio(fHandle, seedRatio) || [self ratio] >= seedRatio || [self ratio] == TR_RATIO_INF)
    348         return 1.0;
    349     else if ([self ratio] == TR_RATIO_NA)
    350         return 0.0;
    351     else
    352         return [self ratio] / seedRatio;
     346    return fStat->percentRatio;
    353347}
    354348
Note: See TracChangeset for help on using the changeset viewer.