Changeset 10078
- Timestamp:
- Feb 2, 2010, 7:48:03 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/rpc-spec.txt
r10065 r10078 331 331 Request arguments: 332 332 333 key | value type & description 334 -------------------+------------------------------------------------- 335 "download-dir" | string path to download the torrent to 336 "filename" | string filename or URL of the .torrent file 337 "metainfo" | string base64-encoded .torrent content 338 "paused" | boolean if true, don't start the torrent 339 "peer-limit" | number maximum number of peers 340 "files-wanted" | array indices of file(s) to download 341 "files-unwanted" | array indices of file(s) to not download 342 "priority-high" | array indices of high-priority file(s) 343 "priority-low" | array indices of low-priority file(s) 344 "priority-normal" | array indices of normal-priority file(s) 333 key | value type & description 334 ---------------------+------------------------------------------------- 335 "download-dir" | string path to download the torrent to 336 "filename" | string filename or URL of the .torrent file 337 "metainfo" | string base64-encoded .torrent content 338 "paused" | boolean if true, don't start the torrent 339 "peer-limit" | number maximum number of peers 340 "bandwidthPriority" | number torrent's bandwidth tr_priority_t 341 "files-wanted" | array indices of file(s) to download 342 "files-unwanted" | array indices of file(s) to not download 343 "priority-high" | array indices of high-priority file(s) 344 "priority-low" | array indices of low-priority file(s) 345 "priority-normal" | array indices of normal-priority file(s) 345 346 346 347 Either "filename" OR "metainfo" MUST be included. … … 577 578 8 | 1.90 | yes | session-set | new arg "rename-partial-files" 578 579 | | yes | session-get | new arg "rename-partial-files" 579 580 | | yes | torrent-add | new arg "bandwidthPriority" -
trunk/libtransmission/rpcimpl.c
r10065 r10078 1062 1062 tr_ctorSetPeerLimit( ctor, TR_FORCE, i ); 1063 1063 1064 if( tr_bencDictFindInt( args_in, "bandwidthPriority", &i ) ) 1065 tr_ctorSetBandwidthPriority( ctor, i ); 1066 1064 1067 if( tr_bencDictFindList( args_in, "files-unwanted", &l ) ) { 1065 1068 tr_file_index_t fileCount; -
trunk/libtransmission/torrent-ctor.c
r9979 r10078 39 39 tr_bool doDelete; 40 40 41 tr_priority_t bandwidthPriority; 41 42 tr_bool isSet_metainfo; 42 43 tr_bool isSet_delete; … … 426 427 ***/ 427 428 429 static tr_bool 430 isPriority( int i ) 431 { 432 return (i==TR_PRI_LOW) || (i==TR_PRI_NORMAL) || (i==TR_PRI_HIGH); 433 } 434 435 void 436 tr_ctorSetBandwidthPriority( tr_ctor * ctor, tr_priority_t priority ) 437 { 438 fprintf( stderr, "in tr_ctorSetPriority with %d\n", (int)priority ); 439 if( isPriority( priority ) ) 440 ctor->bandwidthPriority = priority; 441 } 442 443 tr_priority_t 444 tr_ctorGetBandwidthPriority( const tr_ctor * ctor ) 445 { 446 fprintf( stderr, "got priority with %d\n", (int)ctor->bandwidthPriority ); 447 return ctor->bandwidthPriority; 448 } 449 450 /*** 451 **** 452 ***/ 453 428 454 tr_ctor* 429 455 tr_ctorNew( const tr_session * session ) … … 432 458 433 459 ctor->session = session; 460 ctor->bandwidthPriority = TR_PRI_NORMAL; 434 461 tr_ctorSetPaused( ctor, TR_FALLBACK, FALSE ); 435 462 if( session != NULL ) { -
trunk/libtransmission/torrent.c
r10072 r10078 635 635 tor->bandwidth = tr_bandwidthNew( session, session->bandwidth ); 636 636 637 tor->bandwidth->priority = tr_ctorGetBandwidthPriority( ctor ); 638 637 639 tor->error = TR_STAT_OK; 638 640 -
trunk/libtransmission/transmission.h
r10072 r10078 340 340 const char * tr_sessionGetDownloadDir( const tr_session * session ); 341 341 342 343 /** 344 * @brief Set the torrent's bandwidth priority. 345 */ 346 void tr_ctorSetBandwidthPriority( tr_ctor * ctor, tr_priority_t priority ); 347 348 /** 349 * @brief Get the torrent's bandwidth priority. 350 */ 351 tr_priority_t tr_ctorGetBandwidthPriority( const tr_ctor * ctor ); 352 353 342 354 /** 343 355 * @brief set the per-session incomplete download folder.
Note: See TracChangeset
for help on using the changeset viewer.