Changeset 5537


Ignore:
Timestamp:
Apr 6, 2008, 2:32:43 PM (14 years ago)
Author:
charles
Message:

#843: download eta should consider availability

Location:
branches/1.1x
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/1.1x/gtk/torrent-cell-renderer.c

    r5493 r5537  
    8484        GString * gstr = g_string_new( str );
    8585        g_string_append( gstr, " - " );
    86         if( eta < 0 )
     86        if( eta == TR_ETA_NOT_AVAIL )
     87            g_string_append( gstr, _( "Not available" ) );
     88         else if( eta == TR_ETA_UNKNOWN )
    8789            g_string_append( gstr, _( "Stalled" ) );
    8890        else {
  • branches/1.1x/gtk/tr-torrent.c

    r5313 r5537  
    285285
    286286        case TR_STATUS_DOWNLOAD:
    287             if( eta < 0 )
    288                 top = g_strdup_printf( _("Stalled (%.1f%%)"), prog );
     287
     288            if( eta == TR_ETA_NOT_AVAIL )
     289                top = g_strdup_printf( _("Not available (%.1f%%)" ), prog );
     290            else if( eta == TR_ETA_UNKNOWN )
     291                top = g_strdup_printf( _( "Stalled (%.1f%%)" ), prog );
    289292            else {
    290293                char timestr[128];
  • branches/1.1x/libtransmission/torrent.c

    r5313 r5537  
    625625    s->activityDate = tor->activityDate;
    626626
    627     s->eta = s->rateDownload < 0.1
    628         ? -1.0f
    629         : (s->leftUntilDone / s->rateDownload / 1024.0);
    630 
    631627    s->corruptEver     = tor->corruptCur    + tor->corruptPrev;
    632628    s->downloadedEver  = tor->downloadedCur + tor->downloadedPrev;
     
    658654        tr_bitfieldFree( availablePieces );
    659655    }
     656
     657    if( s->desiredAvailable != s->leftUntilDone )
     658        s->eta = TR_ETA_NOT_AVAIL;
     659    else if( s->rateDownload < 0.1 )
     660        s->eta = TR_ETA_UNKNOWN;
     661    else
     662        s->eta = s->leftUntilDone / (s->rateDownload / 1024.0);
    660663
    661664    s->ratio = tr_getRatio( s->uploadedEver,
  • branches/1.1x/libtransmission/transmission.h

    r5286 r5537  
    793793    char errorString[128];
    794794
    795 
     795    /* [0..1] */
    796796    float recheckProgress;
     797
     798    /* [0..1] */
    797799    float percentComplete;
     800
     801    /* [0..1] */
    798802    float percentDone;
     803
     804    /* KiB/s */
    799805    float rateDownload;
     806
     807    /* KiB/s */
    800808    float rateUpload;
    801809
     810#define TR_ETA_NOT_AVAIL -1
     811#define TR_ETA_UNKNOWN -2
     812    /* seconds */
    802813    int eta;
     814
    803815    int peersKnown;
    804816    int peersConnected;
Note: See TracChangeset for help on using the changeset viewer.