Changeset 9179


Ignore:
Timestamp:
Sep 26, 2009, 6:20:33 AM (11 years ago)
Author:
charles
Message:

(trunk) remove tr_stats fields: downloaders, leechers, seeders, timesCompleted as per discussion with livings

Location:
trunk
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/daemon/remote.c

    r9170 r9179  
    322322    "id",
    323323    "isPrivate",
    324     "leechers",
    325324    "leftUntilDone",
    326325    "name",
     
    333332    "rateUpload",
    334333    "recheckProgress",
    335     "seeders",
    336334    "sizeWhenDone",
    337335    "startDate",
    338336    "status",
    339     "timesCompleted",
    340337    "totalSize",
    341338    "trackerStats",
  • trunk/doc/rpc-spec.txt

    r9173 r9179  
    142142   downloadDir                 | string                      | tr_torrent
    143143   downloadedEver              | number                      | tr_stat
    144    downloaders                 | number                      | tr_stat
    145144   downloadLimit               | number                      | tr_torrent
    146145   downloadLimited             | boolean                     | tr_torrent
     
    156155   id                          | number                      | tr_torrent
    157156   isPrivate                   | boolean                     | tr_torrent
    158    leechers                    | number                      | tr_stat
    159157   leftUntilDone               | number                      | tr_stat
    160158   manualAnnounceTime          | number                      | tr_stat
     
    176174   rateUpload (B/s)            | number                      | tr_stat
    177175   recheckProgress             | double                      | tr_stat
    178    seeders                     | number                      | tr_stat
    179176   seedRatioLimit              | double                      | tr_torrent
    180177   seedRatioMode               | number                      | tr_ratiolimit
     
    183180   status                      | number                      | tr_stat
    184181   swarmSpeed (K/s)            | number                      | tr_stat
    185    timesCompleted              | number                      | tr_stat
    186182   trackers                    | array (see below)           | n/a
    187183   trackerStats                | array (see below)           | n/a
     
    556552   7     | 1.80    |        NO | torrent-get    | removed arg "announceResponse"
    557553         |         |        NO | torrent-get    | removed arg "announceURL"
     554         |         |        NO | torrent-get    | removed arg "downloaders"
    558555         |         |        NO | torrent-get    | removed arg "lastAnnounceTime"
    559556         |         |        NO | torrent-get    | removed arg "lastScrapeTime"
     557         |         |        NO | torrent-get    | removed arg "leechers"
    560558         |         |        NO | torrent-get    | removed arg "nextAnnounceTime"
    561559         |         |        NO | torrent-get    | removed arg "nextScrapeTime"
    562560         |         |        NO | torrent-get    | removed arg "scrapeResponse"
    563561         |         |        NO | torrent-get    | removed arg "scrapeURL"
     562         |         |        NO | torrent-get    | removed arg "seeders"
     563         |         |        NO | torrent-get    | removed arg "timesCompleted"
    564564         |         | yes    NO | torrent-get    | new arg "trackerStats"
    565565
  • trunk/gtk/details.c

    r9172 r9179  
    8383    GtkListStore * peer_store;
    8484    GtkListStore * webseed_store;
    85     GtkWidget * seeders_lb;
    86     GtkWidget * leechers_lb;
    87     GtkWidget * completed_lb;
    8885    GtkWidget * webseed_view;
    8986
     
    13421339refreshPeers( struct DetailsImpl * di, tr_torrent ** torrents, int n )
    13431340{
    1344     int i;
    1345     char buf[512];
    1346     const char * none = _( "None" );
    1347 
    1348     /* seeders_lb */
    1349     /* leechers_lb */
    1350     /* completed_lb */
    1351     if( n<=0 ) {
    1352         gtk_label_set_text( GTK_LABEL( di->seeders_lb ), none );
    1353         gtk_label_set_text( GTK_LABEL( di->leechers_lb ), none );
    1354         gtk_label_set_text( GTK_LABEL( di->completed_lb ), none );
    1355     } else {
    1356         int seeders = 0;
    1357         int leechers = 0;
    1358         int completed = 0;
    1359         for( i=0; i<n; ++i ) {
    1360             const tr_stat * s = tr_torrentStat( torrents[i] );
    1361             seeders = s->seeders;
    1362             leechers = s->leechers;
    1363             completed += s->timesCompleted;
    1364         }
    1365         g_snprintf( buf, sizeof( buf ), "%'d", seeders );
    1366         gtk_label_set_text( GTK_LABEL( di->seeders_lb ), buf );
    1367         g_snprintf( buf, sizeof( buf ), "%'d", leechers );
    1368         gtk_label_set_text( GTK_LABEL( di->leechers_lb ), buf );
    1369         g_snprintf( buf, sizeof( buf ), "%'d", completed );
    1370         gtk_label_set_text( GTK_LABEL( di->completed_lb ), buf );
    1371     }
    1372 
    13731341    refreshPeerList( di, torrents, n );
    13741342    refreshWebseedList( di, torrents, n );
     
    14341402    const char * str;
    14351403    GtkListStore *store;
    1436     GtkWidget *v, *w, *ret, *sw, *l, *vbox, *hbox;
     1404    GtkWidget *v, *w, *ret, *sw, *vbox;
    14371405    GtkWidget *webtree = NULL;
    14381406    GtkTreeModel * m;
     
    15961564    gtk_paned_pack2( GTK_PANED( v ), sw, TRUE, TRUE );
    15971565    gtk_box_pack_start( GTK_BOX( vbox ), v, TRUE, TRUE, 0 );
    1598 
    1599     hbox = gtk_hbox_new( FALSE, GUI_PAD );
    1600     l = gtk_label_new( NULL );
    1601     gtk_label_set_markup( GTK_LABEL( l ), _( "<b>Seeders:</b>" ) );
    1602     gtk_box_pack_start( GTK_BOX( hbox ), l, FALSE, FALSE, 0 );
    1603     l = di->seeders_lb = gtk_label_new( NULL );
    1604     gtk_box_pack_start( GTK_BOX( hbox ), l, FALSE, FALSE, 0 );
    1605     w = gtk_alignment_new( 0.0f, 0.0f, 0.0f, 0.0f );
    1606     gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
    1607     l = gtk_label_new( NULL );
    1608     gtk_label_set_markup( GTK_LABEL( l ), _( "<b>Leechers:</b>" ) );
    1609     gtk_box_pack_start( GTK_BOX( hbox ), l, FALSE, FALSE, 0 );
    1610     l = di->leechers_lb = gtk_label_new( NULL );
    1611     gtk_box_pack_start( GTK_BOX( hbox ), l, FALSE, FALSE, 0 );
    1612     w = gtk_alignment_new( 0.0f, 0.0f, 0.0f, 0.0f );
    1613     gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
    1614     l = gtk_label_new( NULL );
    1615     gtk_label_set_markup( GTK_LABEL( l ), _( "<b>Times Completed:</b>" ) );
    1616     gtk_box_pack_start( GTK_BOX( hbox ), l, FALSE, FALSE, 0 );
    1617     l = di->completed_lb = gtk_label_new( NULL );
    1618     gtk_box_pack_start( GTK_BOX( hbox ), l, FALSE, FALSE, 0 );
    1619     gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
    16201566
    16211567    /* ip-to-GtkTreeRowReference */
  • trunk/libtransmission/announcer.c

    r9176 r9179  
    15741574****
    15751575***/
    1576 
    1577 void
    1578 tr_announcerGetCounts( tr_torrent * torrent,
    1579                        int * setme_completedCount,
    1580                        int * setme_leecherCount,
    1581                        int * setme_seederCount,
    1582                        int * setme_downloaderCount )
    1583 {
    1584     int i;
    1585     int n;
    1586     int completed = 0;
    1587     int leechers = 0;
    1588     int seeders = 0;
    1589     int downloaders = 0;
    1590 
    1591     /* count the trackers... */
    1592     for( i=0, n=tr_ptrArraySize( &torrent->tiers->tiers ); i<n; ++i )
    1593     {
    1594         const tr_tier * tier = tr_ptrArrayNth( &torrent->tiers->tiers, i );
    1595 
    1596         if( tier->currentTracker )
    1597         {
    1598             seeders += tier->currentTracker->seederCount;
    1599             leechers += tier->currentTracker->leecherCount;
    1600             completed += tier->currentTracker->downloadCount;
    1601             downloaders += tier->currentTracker->downloaderCount;
    1602         }
    1603     }
    1604 
    1605     if( setme_completedCount )  *setme_completedCount = completed;
    1606     if( setme_leecherCount )    *setme_leecherCount = leechers;
    1607     if( setme_seederCount )     *setme_seederCount = seeders;
    1608     if( setme_downloaderCount ) *setme_downloaderCount = downloaders;
    1609 }
    16101576
    16111577tr_tracker_stat *
  • trunk/libtransmission/announcer.h

    r9170 r9179  
    8989time_t tr_announcerNextManualAnnounce( const tr_torrent * );
    9090
    91 void tr_announcerGetCounts( tr_torrent *,
    92                             int * setme_completedCount,
    93                             int * setme_leecherCount,
    94                             int * setme_seederCount,
    95                             int * setme_downloaderCount );
    96 
    9791tr_tracker_stat * tr_announcerStats( const tr_torrent * torrent,
    9892                                     int              * setmeTrackerCount );
  • trunk/libtransmission/rpcimpl.c

    r9173 r9179  
    471471    else if( tr_streq( key, keylen, "downloadedEver" ) )
    472472        tr_bencDictAddInt( d, key, st->downloadedEver );
    473     else if( tr_streq( key, keylen, "downloaders" ) )
    474         tr_bencDictAddInt( d, key, st->downloaders );
    475473    else if( tr_streq( key, keylen, "downloadLimit" ) )
    476474        tr_bencDictAddInt( d, key, tr_torrentGetSpeedLimit( tor, TR_DOWN ) );
     
    499497    else if( tr_streq( key, keylen, "isPrivate" ) )
    500498        tr_bencDictAddBool( d, key, tr_torrentIsPrivate( tor ) );
    501     else if( tr_streq( key, keylen, "leechers" ) )
    502         tr_bencDictAddInt( d, key, st->leechers );
    503499    else if( tr_streq( key, keylen, "leftUntilDone" ) )
    504500        tr_bencDictAddInt( d, key, st->leftUntilDone );
     
    555551    else if( tr_streq( key, keylen, "recheckProgress" ) )
    556552        tr_bencDictAddReal( d, key, st->recheckProgress );
    557     else if( tr_streq( key, keylen, "seeders" ) )
    558         tr_bencDictAddInt( d, key, st->seeders );
    559553    else if( tr_streq( key, keylen, "seedRatioLimit" ) )
    560554        tr_bencDictAddReal( d, key, tr_torrentGetRatioLimit( tor ) );
     
    569563    else if( tr_streq( key, keylen, "swarmSpeed" ) )
    570564        tr_bencDictAddInt( d, key, (int)( st->swarmSpeed * 1024 ) );
    571     else if( tr_streq( key, keylen, "timesCompleted" ) )
    572         tr_bencDictAddInt( d, key, st->timesCompleted );
    573565    else if( tr_streq( key, keylen, "trackers" ) )
    574566        addTrackers( inf, tr_bencDictAddList( d, key, inf->trackerCount ) );
  • trunk/libtransmission/torrent.c

    r9170 r9179  
    890890
    891891    s->manualAnnounceTime = tr_announcerNextManualAnnounce( tor );
    892 
    893     tr_announcerGetCounts( tor, &s->timesCompleted,
    894                                 &s->leechers,
    895                                 &s->seeders,
    896                                 &s->downloaders );
    897892
    898893    tr_peerMgrTorrentStats( tor,
  • trunk/libtransmission/transmission.h

    r9173 r9179  
    15711571    int    webseedsSendingToUs;
    15721572
    1573     /** Number of seeders that the tracker says this torrent has */
    1574     int    seeders;
    1575 
    1576     /** Number of leechers that the tracker says this torrent has */
    1577     int    leechers;
    1578 
    1579     /** Number of downloaders that the tracker says this torrent has.
    1580         This is a new key introduced in BEP 21 and may not be supported by some trackers.
    1581         If the tracker doesn't support this key, the value here will be -1. */
    1582     int    downloaders;
    1583 
    1584     /** Number of finished downloads that the tracker says torrent has */
    1585     int    timesCompleted;
    1586 
    15871573    /** Byte count of all the piece data we'll have downloaded when we're done,
    15881574        whether or not we have it yet.  This may be less than tr_info.totalSize
  • trunk/qt/details.cc

    r8764 r9179  
    212212Details :: refresh( )
    213213{
    214     int i;
    215214    QLocale locale;
    216215    const int n = myIds.size( );
     
    678677    ///  Peers tab
    679678    ///
    680 
    681     i = 0;
    682     foreach( const Torrent * t, torrents ) i += t->seeders( );
    683     mySeedersLabel->setText( locale.toString( i ) );
    684 
    685     i = 0;
    686     foreach( const Torrent * t, torrents ) i += t->leechers( );
    687     myLeechersLabel->setText( locale.toString( i ) );
    688 
    689     i = 0;
    690     foreach( const Torrent * t, torrents ) i += t->timesCompleted( );
    691     myTimesCompletedLabel->setText( locale.toString( i ) );
    692679
    693680    QMap<QString,QTreeWidgetItem*> peers2;
     
    10511038    myPeerTree->setAlternatingRowColors( true );
    10521039
    1053     QHBoxLayout * h = new QHBoxLayout;
    1054     h->setSpacing( HIG :: PAD );
    1055     v->addLayout( h );
    1056 
    1057     QLabel * l = new QLabel( "Seeders:" );
    1058     l->setStyleSheet( "font: bold" );
    1059     h->addWidget( l );
    1060     l = mySeedersLabel = new QLabel( "a" );
    1061     h->addWidget( l );
    1062     h->addStretch( 1 );
    1063    
    1064     l = new QLabel( "Leechers:" );
    1065     l->setStyleSheet( "font: bold" );
    1066     h->addWidget( l );
    1067     l = myLeechersLabel = new QLabel( "b" );
    1068     h->addWidget( l );
    1069     h->addStretch( 1 );
    1070    
    1071     l = new QLabel( "Times Completed:" );
    1072     l->setStyleSheet( "font: bold" );
    1073     h->addWidget( l );
    1074     l = myTimesCompletedLabel = new QLabel( "c" );
    1075     h->addWidget( l );
    1076 
    10771040    return top;
    10781041}
  • trunk/qt/details.h

    r8903 r9179  
    107107        QLabel * myAnnounceManualLabel;
    108108
    109         QLabel * mySeedersLabel;
    110         QLabel * myLeechersLabel;
    111         QLabel * myTimesCompletedLabel;
    112109        QTreeWidget * myPeerTree;
    113110        QMap<QString,QTreeWidgetItem*> myPeers;
  • trunk/qt/torrent.cc

    r8875 r9179  
    106106    { ANNOUNCE_RESPONSE, "announceResponse", QVariant::String, STAT_EXTRA },
    107107    { ANNOUNCE_URL, "announceURL", QVariant::String, STAT_EXTRA },
    108     { SEEDERS, "seeders", QVariant::Int, STAT_EXTRA },
    109     { LEECHERS, "leechers", QVariant::Int, STAT_EXTRA },
    110     { TIMES_COMPLETED, "timesCompleted", QVariant::Int, STAT_EXTRA },
    111108    { PEERS, "peers", TrTypes::PeerList, STAT_EXTRA },
    112109    { TORRENT_FILE, "torrentFile", QVariant::String, STAT_EXTRA },
  • trunk/qt/torrent.h

    r8869 r9179  
    136136            ANNOUNCE_RESPONSE,
    137137            ANNOUNCE_URL,
    138             SEEDERS,
    139             LEECHERS,
    140             TIMES_COMPLETED,
    141138            PEERS,
    142139            TORRENT_FILE,
     
    267264        double seedRatioLimit( ) const { return getDouble( SEED_RATIO_LIMIT ); }
    268265        tr_ratiolimit seedRatioMode( ) const { return (tr_ratiolimit) getInt( SEED_RATIO_MODE ); }
    269         int seeders() const { return getInt( SEEDERS ); }
    270         int leechers() const { return getInt( LEECHERS ); }
    271         int timesCompleted() const { return getInt( TIMES_COMPLETED ); }
    272266        PeerList peers( ) const{ return myValues[PEERS].value<PeerList>(); }
    273267        const FileList& files( ) const { return myFiles; }
  • trunk/web/index.html

    r8787 r9179  
    174174                                                <div class="inspector_label">DL From:</div>
    175175                                                <div id="torrent_inspector_download_from">N/A</div>
    176                                         </div>
    177                                         <div class="inspector_row">
    178                                                 <div class="inspector_label">Total Seeders:</div>
    179                                                 <div id="torrent_inspector_total_seeders">N/A</div>
    180                                         </div>
    181                                         <div class="inspector_row">
    182                                                 <div class="inspector_label">Total Leechers:</div>
    183                                                 <div id="torrent_inspector_total_leechers">N/A</div>
    184176                                        </div>
    185177                                </div><!-- class="inspector_group"-->
  • trunk/web/javascript/torrent.js

    r9119 r9179  
    3131    'dateCreated', 'hashString', 'id', 'isPrivate', 'name', 'totalSize' ]
    3232Torrent._DynamicFields = [ 'downloadedEver', 'error', 'errorString', 'eta',
    33     'haveUnchecked', 'haveValid', 'leechers', 'leftUntilDone', 'peersConnected',
     33    'haveUnchecked', 'haveValid', 'leftUntilDone', 'peersConnected',
    3434    'peersGettingFromUs', 'peersSendingToUs', 'rateDownload', 'rateUpload',
    35     'recheckProgress', 'seeders', 'sizeWhenDone', 'status', 'swarmSpeed',
     35    'recheckProgress', 'sizeWhenDone', 'status', 'swarmSpeed',
    3636    'uploadedEver', 'uploadRatio', 'seedRatioLimit', 'seedRatioMode', 'downloadDir' ]
    3737
     
    207207        },
    208208        swarmSpeed: function() { return this._swarm_speed; },
    209         totalLeechers: function() { return this._total_leechers; },
    210         totalSeeders: function() { return this._total_seeders; },
    211209        uploadSpeed: function() { return this._upload_speed; },
    212210        uploadTotal: function() { return this._upload_total; },
     
    333331                this._eta                   = data.eta;
    334332                this._swarm_speed           = data.swarmSpeed;
    335                 this._total_leechers        = Math.max( 0, data.leechers );
    336                 this._total_seeders         = Math.max( 0, data.seeders );
    337333                this._state                 = data.status;
    338334                this._download_dir          = data.downloadDir;
  • trunk/web/javascript/transmission.js

    r9031 r9179  
    9999                this._inspector._info_tab.state = $(ti+'state')[0];
    100100                this._inspector._info_tab.swarm_speed = $(ti+'swarm_speed')[0];
    101                 this._inspector._info_tab.total_leechers = $(ti+'total_leechers')[0];
    102                 this._inspector._info_tab.total_seeders = $(ti+'total_seeders')[0];
    103101                this._inspector._info_tab.tracker = $(ti+'tracker')[0];
    104102                this._inspector._info_tab.uploaded = $(ti+'uploaded')[0];
     
    937935                var total_download_speed = 0;
    938936                var total_have = 0;
    939                 var total_leechers = 0;
    940937                var total_size = 0;
    941                 var total_seeders = 0;
    942938                var total_state = null;
    943939                var total_swarm_speed = 0;
     
    964960                        setInnerHTML( tab.downloaded, na );
    965961                        setInnerHTML( tab.ratio, na );
    966                         setInnerHTML( tab.total_seeders, na );
    967                         setInnerHTML( tab.total_leechers, na );
    968962                        setInnerHTML( tab.swarm_speed, na );
    969963                        setInnerHTML( tab.have, na );
     
    10121006                        total_upload_speed   += t.uploadSpeed();
    10131007                        total_download_speed += t.downloadSpeed();
    1014                         total_seeders        += t.totalSeeders();
    1015                         total_leechers       += t.totalLeechers();
    10161008                        total_upload_peers   += t.peersGettingFromUs();
    10171009                        total_download_peers += t.peersSendingToUs();
     
    10471039                setInnerHTML( tab.downloaded, torrents.length ? Math.formatBytes( total_download ) : na );
    10481040                setInnerHTML( tab.ratio, torrents.length ? Math.ratio( total_upload, total_download ) : na );
    1049                 setInnerHTML( tab.total_seeders, torrents.length ? total_seeders : na );
    1050                 setInnerHTML( tab.total_leechers, torrents.length ? total_leechers : na );
    10511041                setInnerHTML( tab.swarm_speed, torrents.length ? Math.formatBytes(total_swarm_speed) + '/s' : na );
    10521042                setInnerHTML( tab.have, torrents.length ? Math.formatBytes(total_completed) + ' (' + Math.formatBytes(total_verified) + ' verified)' : na );
Note: See TracChangeset for help on using the changeset viewer.