Changeset 8121
- Timestamp:
- Mar 31, 2009, 10:13:43 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/rpc-spec.txt
r8111 r8121 154 154 eta | number | tr_stat 155 155 files | array (see below) | n/a 156 fileStats | array (see below) | n/a 156 157 hashString | string | tr_info 157 158 haveUnchecked | number | tr_stat … … 214 215 | name | string | tr_info 215 216 -----------------------+--------------------------------------+ 217 fileStats | a file's non-constant properties. | 218 | array of tr_info.filecount objects, | 219 | each containing: | 220 +-------------------------+------------+ 221 | bytesCompleted | number | tr_torrent 222 | wanted | 'boolean' | tr_info 223 | priority | number | tr_info 224 -----------------------+--------------------------------------+ 216 225 peers | array of objects, each containing: | 217 226 +-------------------------+------------+ … … 441 450 ------+---------+-----------+----------------+------------------------------- 442 451 6 | 1.60 | yes | torrent-get | new arg "pieces" 452 | | yes | torrent-get | new arg "fileStats" 443 453 | | yes | torrent-set | new arg "ratio" 444 454 | | yes | torrent-set | new arg "downloadLimited" -
trunk/libtransmission/rpcimpl.c
r8111 r8121 288 288 **** 289 289 ***/ 290 291 static void 292 addFileStats( const tr_torrent * tor, tr_benc * list ) 293 { 294 tr_file_index_t i; 295 tr_file_index_t n; 296 const tr_info * info = tr_torrentInfo( tor ); 297 tr_file_stat * files = tr_torrentFiles( tor, &n ); 298 299 for( i = 0; i < info->fileCount; ++i ) 300 { 301 const tr_file * file = &info->files[i]; 302 tr_benc * d = tr_bencListAddDict( list, 3 ); 303 tr_bencDictAddInt( d, "bytesCompleted", files[i].bytesCompleted ); 304 tr_bencDictAddInt( d, "priority", file->priority ); 305 tr_bencDictAddBool( d, "wanted", !file->dnd ); 306 } 307 308 tr_torrentFilesFree( files, n ); 309 } 290 310 291 311 static void … … 416 436 else if( !strcmp( key, "files" ) ) 417 437 addFiles( tor, tr_bencDictAddList( d, key, inf->fileCount ) ); 438 else if( !strcmp( key, "fileStats" ) ) 439 addFileStats( tor, tr_bencDictAddList( d, key, inf->fileCount ) ); 418 440 else if( !strcmp( key, "hashString" ) ) 419 441 tr_bencDictAddStr( d, key, tor->info.hashString );
Note: See TracChangeset
for help on using the changeset viewer.