mirror of
https://github.com/transmission/transmission
synced 2025-03-03 10:15:45 +00:00
(trunk libT) #4969 "jsonrpc response to torrent-get emits malformed json" -- fixed.
This commit is contained in:
parent
cdd71c6427
commit
9b98c0fc2e
1 changed files with 13 additions and 6 deletions
|
@ -1145,16 +1145,23 @@ tr_torrentIsStalled( const tr_torrent * tor )
|
|||
static double
|
||||
getVerifyProgress( const tr_torrent * tor )
|
||||
{
|
||||
tr_piece_index_t i, n;
|
||||
tr_piece_index_t checked = 0;
|
||||
double d = 0;
|
||||
|
||||
assert( tr_isTorrent( tor ) );
|
||||
|
||||
for( i=0, n=tor->info.pieceCount; i!=n; ++i )
|
||||
if( tor->info.pieces[i].timeChecked )
|
||||
++checked;
|
||||
if( tr_torrentHasMetadata( tor ) )
|
||||
{
|
||||
tr_piece_index_t i, n;
|
||||
tr_piece_index_t checked = 0;
|
||||
|
||||
return checked / (double)tor->info.pieceCount;
|
||||
for( i=0, n=tor->info.pieceCount; i!=n; ++i )
|
||||
if( tor->info.pieces[i].timeChecked )
|
||||
++checked;
|
||||
|
||||
d = checked / (double)tor->info.pieceCount;
|
||||
}
|
||||
|
||||
return d;
|
||||
}
|
||||
|
||||
const tr_stat *
|
||||
|
|
Loading…
Reference in a new issue