Changeset 6237


Ignore:
Timestamp:
Jun 21, 2008, 3:08:34 PM (14 years ago)
Author:
charles
Message:

(rpc) remove the sort and filter options from the "torrent-get" rpc command. NOTE: probably breaks the mac build; xcode needs to drop "rpc-utils" from its list of libtransmission source files

Location:
trunk
Files:
2 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/rpc-spec.txt

    r6234 r6237  
    106106   "fields"     | yes       | n/a     | number    bitwise-or'ed field
    107107                |           |         |           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 ascending
    112    "filter"     | no        | "all"   | string    "active", "all", "paused",
    113                 |           |         |           "downloading", or "seeding".
    114108
    115109   Response arguments:
  • trunk/libtransmission/Makefile.am

    r6203 r6237  
    3434    rpc.c \
    3535    rpc-server.c \
    36     rpc-utils.c \
    3736    session.c \
    3837    stats.c \
     
    7978    rpc.h \
    8079    rpc-server.h \
    81     rpc-utils.h \
    8280    session.h \
    8381    stats.h \
  • trunk/libtransmission/rpc.c

    r6234 r6237  
    2020#include "ratecontrol.h"
    2121#include "rpc.h"
    22 #include "rpc-utils.h"
    2322#include "json.h"
    2423#include "session.h"
     
    4645getTorrents( tr_handle * handle, tr_benc * args, int * setmeCount )
    4746{
    48     int method;
    4947    int torrentCount = 0;
    5048    int64_t id;
    51     int64_t sortAscending;
    5249    tr_torrent ** torrents = NULL;
    53     const char * str;
    5450    tr_benc * ids;
    5551
     
    9591            torrents[torrentCount++] = tor;
    9692    }
    97 
    98     /***
    99     ****  filter the torrents
    100     ***/
    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 torrents
    114     ***/
    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 );
    12993
    13094    /***
Note: See TracChangeset for help on using the changeset viewer.