Changeset 7331
- Timestamp:
- Dec 9, 2008, 5:01:49 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/daemon/remote.c
r7202 r7331 100 100 { 'r', "remove", "Remove the current torrent(s)", 101 101 "r", 0, NULL }, 102 { 'R', "remove-and-delete", "Remove the current torrent(s) and delete local data", 103 NULL, 0, NULL }, 102 104 { 's', "start", "Start the current torrent(s)", 103 105 "s", 0, NULL }, … … 413 415 tr_bencDictAddStr( &top, "method", "torrent-remove" ); 414 416 addIdArg( args, id ); 417 break; 418 419 case 'R': 420 tr_bencDictAddStr( &top, "method", "torrent-remove" ); 421 addIdArg( args, id ); 422 tr_bencDictAddInt( args, "delete-local-data", 1 ); 415 423 break; 416 424 -
trunk/daemon/transmission-remote.1
r7108 r7331 29 29 .Op Fl pn Ar files 30 30 .Op Fl r 31 .Op Fl R 31 32 .Op Fl s | S 32 33 .Op Fl t Ar all | Ar id | Ar hash … … 134 135 .It Fl r Fl -remove 135 136 Remove the current torrent(s). This does not delete the downloaded data. 137 138 .It Fl -remove-and-delete 139 Remove the current torrent(s) and delete their downloaded data. 136 140 137 141 .It Fl s Fl -start -
trunk/doc/rpc-spec.txt
r7264 r7331 69 69 Method name | libtransmission function 70 70 --------------------+------------------------------------------------- 71 "torrent-remove" | tr_torrentRemove72 71 "torrent-start" | tr_torrentStart 73 72 "torrent-stop" | tr_torrentStop … … 294 293 fields for id, name, and hashString. 295 294 295 3.5. Removing a Torrent 296 297 Method name: "torrent-remove" 298 299 Request arguments: 300 301 string | value type & description 302 ---------------------------+------------------------------------------------- 303 "ids" | array torrent list, as described in 3.1 304 "delete-local-data" | 'boolean' delete local data. (default: false) 305 306 Response arguments: none 307 296 308 297 309 4. Session Requests -
trunk/libtransmission/rpcimpl.c
r7238 r7331 137 137 138 138 static const char* 139 torrentRemove( tr_handle * h, 140 tr_benc * args_in, 141 tr_benc * args_out UNUSED ) 142 { 143 int i, torrentCount; 139 torrentRemove( tr_handle * h, 140 tr_benc * args_in, 141 tr_benc * args_out UNUSED ) 142 { 143 int i; 144 int torrentCount; 144 145 tr_torrent ** torrents = getTorrents( h, args_in, &torrentCount ); 145 146 146 for( i = 0; i < torrentCount; ++i ) 147 { 148 tr_torrent * tor = torrents[i]; 149 const tr_rpc_callback_status status = notify( 150 h, TR_RPC_TORRENT_REMOVING, tor ); 147 for( i=0; i<torrentCount; ++i ) 148 { 149 tr_torrent * tor = torrents[i]; 150 const tr_rpc_callback_status status = notify( h, TR_RPC_TORRENT_REMOVING, tor ); 151 int64_t deleteFlag; 152 if( tr_bencDictFindInt( args_in, "delete-local-data", &deleteFlag ) && deleteFlag ) 153 tr_torrentDeleteLocalData( tor ); 151 154 if( !( status & TR_RPC_NOREMOVE ) ) 152 155 tr_torrentRemove( tor ); -
trunk/libtransmission/torrent.c
r7329 r7331 1199 1199 1200 1200 void 1201 tr_torrentDeleteLocalData( tr_torrent * tor ) 1202 { 1203 tr_file_index_t i; 1204 1205 for( i=0; i<tor->info.fileCount; ++i ) 1206 { 1207 const tr_file * file = &tor->info.files[i]; 1208 char * path = tr_buildPath( tor->downloadDir, file->name, NULL ); 1209 tr_fdFileClose( path ); 1210 unlink( path ); 1211 tr_free( path ); 1212 } 1213 } 1214 1215 void 1201 1216 tr_torrentStop( tr_torrent * tor ) 1202 1217 { -
trunk/libtransmission/tr-getopt.c
r7200 r7331 48 48 const char * arg = getArgName( opt ); 49 49 50 printf( " -%-*s --%-*s %-*s %s\n", shortWidth, shortName, 51 longWidth, longName, 50 printf( " %s%-*s %s%-*s %-*s %s\n", 51 (shortName && *shortName ? "-" : " "), shortWidth, shortName, 52 (longName && *longName ? "--" : " "), longWidth, longName, 52 53 argWidth, arg, 53 54 opt->description ); -
trunk/libtransmission/transmission.h
r7256 r7331 841 841 void tr_torrentStop( tr_torrent * torrent ); 842 842 843 /** @brief Deletes the torrent data stored on disk. */ 844 void tr_torrentDeleteLocalData( tr_torrent * torrent ); 845 843 846 /** 844 847 * @brief Iterate through the torrents.
Note: See TracChangeset
for help on using the changeset viewer.