Changeset 6237
- Timestamp:
- Jun 21, 2008, 3:08:34 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/rpc-spec.txt
r6234 r6237 106 106 "fields" | yes | n/a | number bitwise-or'ed field 107 107 | | | values from the table below 108 "sort" | no | "id" | string "activity", "age", "id",109 | | | "name", "progress", "ratio",110 | | | "state", or "tracker".111 "ascending" | no | 'true' | 'boolean' true if sorting ascending112 "filter" | no | "all" | string "active", "all", "paused",113 | | | "downloading", or "seeding".114 108 115 109 Response arguments: -
trunk/libtransmission/Makefile.am
r6203 r6237 34 34 rpc.c \ 35 35 rpc-server.c \ 36 rpc-utils.c \37 36 session.c \ 38 37 stats.c \ … … 79 78 rpc.h \ 80 79 rpc-server.h \ 81 rpc-utils.h \82 80 session.h \ 83 81 stats.h \ -
trunk/libtransmission/rpc.c
r6234 r6237 20 20 #include "ratecontrol.h" 21 21 #include "rpc.h" 22 #include "rpc-utils.h"23 22 #include "json.h" 24 23 #include "session.h" … … 46 45 getTorrents( tr_handle * handle, tr_benc * args, int * setmeCount ) 47 46 { 48 int method;49 47 int torrentCount = 0; 50 48 int64_t id; 51 int64_t sortAscending;52 49 tr_torrent ** torrents = NULL; 53 const char * str;54 50 tr_benc * ids; 55 51 … … 95 91 torrents[torrentCount++] = tor; 96 92 } 97 98 /***99 **** filter the torrents100 ***/101 102 method = TR_FILTER_ALL;103 if( tr_bencDictFindStr( args, "filter", &str ) ) {104 if( !strcmp( str, "active" ) ) method = TR_FILTER_ACTIVE;105 else if( !strcmp( str, "downloading" ) ) method = TR_FILTER_DOWNLOADING;106 else if( !strcmp( str, "paused" ) ) method = TR_FILTER_PAUSED;107 else if( !strcmp( str, "seeding" ) ) method = TR_FILTER_SEEDING;108 }109 if( method != TR_FILTER_ALL )110 tr_torrentFilter( torrents, &torrentCount, method );111 112 /***113 **** sort the torrents114 ***/115 116 method = TR_SORT_ID;117 sortAscending = 1;118 tr_bencDictFindInt( args, "ascending", &sortAscending );119 if( tr_bencDictFindStr( args, "sort", &str ) ) {120 if( !strcmp( str, "activity" ) ) method = TR_SORT_ACTIVITY;121 else if( !strcmp( str, "age" ) ) method = TR_SORT_AGE;122 else if( !strcmp( str, "name" ) ) method = TR_SORT_NAME;123 else if( !strcmp( str, "progress" ) ) method = TR_SORT_PROGRESS;124 else if( !strcmp( str, "ratio" ) ) method = TR_SORT_RATIO;125 else if( !strcmp( str, "state" ) ) method = TR_SORT_STATE;126 else if( !strcmp( str, "tracker" ) ) method = TR_SORT_TRACKER;127 }128 tr_torrentSort( torrents, torrentCount, method, sortAscending!=0 );129 93 130 94 /***
Note: See TracChangeset
for help on using the changeset viewer.