diff --git a/doc/rpc-spec.txt b/doc/rpc-spec.txt index 519765e57..bd5464c66 100644 --- a/doc/rpc-spec.txt +++ b/doc/rpc-spec.txt @@ -175,6 +175,7 @@ peersGettingFromUs | number | tr_stat peersKnown | number | tr_stat peersSendingToUs | number | tr_stat + percentDone | 'double' | tr_stat pieces | string (see below) | tr_torrent pieceCount | tnumber | tr_info pieceSize | tnumber | tr_info @@ -457,6 +458,7 @@ | | yes | torrent-get | new arg "seedRatioLimit" | | yes | torrent-get | new arg "seedRatioMode" | | yes | torrent-get | new ids option "recently-active" + | | yes | torrent-get | new ids option "percentDone" | | yes | | new method "torrent-reannounce" | | NO | torrent-get | removed arg "downloadLimitMode" | | NO | torrent-get | removed arg "uploadLimitMode" diff --git a/libtransmission/rpcimpl.c b/libtransmission/rpcimpl.c index 97598112f..e6165bb30 100644 --- a/libtransmission/rpcimpl.c +++ b/libtransmission/rpcimpl.c @@ -445,6 +445,8 @@ addField( const tr_torrent * tor, tr_bencDictAddInt( d, key, st->nextAnnounceTime ); else if( !strcmp( key, "nextScrapeTime" ) ) tr_bencDictAddInt( d, key, st->nextScrapeTime ); + else if( !strcmp( key, "percentDone" ) ) + tr_bencDictAddReal( d, key, st->percentDone ); else if( !strcmp( key, "peer-limit" ) ) tr_bencDictAddInt( d, key, tr_torrentGetPeerLimit( tor ) ); else if( !strcmp( key, "peers" ) )