From 235dbf607b80373491217a43865aaecf649eb899 Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Wed, 30 Jun 2010 05:54:19 +0000 Subject: [PATCH] (daemon) #3368:Edit trackers in transmission-remote --- daemon/remote.c | 16 ++++++++++++++++ daemon/transmission-remote.1 | 4 ++++ 2 files changed, 20 insertions(+) diff --git a/daemon/remote.c b/daemon/remote.c index 7c9a2e18f..071db1a59 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -244,6 +244,8 @@ static tr_option opts[] = { 952, "no-seedratio", "Let the current torrent(s) seed regardless of ratio", "SR", 0, NULL }, { 953, "global-seedratio", "All torrents, unless overridden by a per-torrent setting, should seed until a specific ratio", "gsr", 1, "ratio" }, { 954, "no-global-seedratio", "All torrents, unless overridden by a per-torrent setting, should seed regardless of ratio", "GSR", 0, NULL }, + { 710, "tracker-add", "Add a tracker to a torrent", "ta", 1, "" }, + { 712, "tracker-remove", "Remove a tracker from a torrent", "tr", 1, "" }, { 's', "start", "Start the current torrent(s)", "s", 0, NULL }, { 'S', "stop", "Stop the current torrent(s)", "S", 0, NULL }, { 't', "torrent", "Set the current torrent(s)", "t", 1, "" }, @@ -355,6 +357,7 @@ getOptMode( int val ) case 993: /* no-trash-torrent */ return MODE_SESSION_SET; + case 712: /* tracker-remove */ case 950: /* seedratio */ case 951: /* seedratio-default */ case 952: /* no-seedratio */ @@ -370,6 +373,7 @@ getOptMode( int val ) case 700: /* torrent priority-high */ case 701: /* torrent priority-normal */ case 702: /* torrent priority-low */ + case 710: /* tracker-add */ case 900: /* file priority-high */ case 901: /* file priority-normal */ case 902: /* file priority-low */ @@ -1934,6 +1938,12 @@ processArgs( const char * host, int port, int argc, const char ** argv ) switch( c ) { + case 712: + { + tr_benc * trackers = tr_bencDictAddDict( args, "trackerRemove", 1 ); + tr_bencDictAddInt( trackers, "id", atoi(optarg) ); + break; + } case 950: tr_bencDictAddReal( args, "seedRatioLimit", atof(optarg) ); tr_bencDictAddInt( args, "seedRatioMode", TR_RATIOLIMIT_SINGLE ); break; @@ -1976,6 +1986,12 @@ processArgs( const char * host, int port, int argc, const char ** argv ) break; case 702: tr_bencDictAddInt( args, "bandwidthPriority", -1 ); break; + case 710: + { + tr_benc * trackers = tr_bencDictAddDict( args, "trackerAdd", 1 ); + tr_bencDictAddStr( trackers, "announce", optarg ); + break; + } default: assert( "unhandled value" && 0 ); break; } diff --git a/daemon/transmission-remote.1 b/daemon/transmission-remote.1 index 38f3579c7..adb5ee0be 100644 --- a/daemon/transmission-remote.1 +++ b/daemon/transmission-remote.1 @@ -220,6 +220,10 @@ Let the current torrent(s) seed until a specific Let the current torrent(s) seed regardless of ratio .It Fl srd Fl -seedratio-default Let the current torrent(s) use the global seedratio settings +.It Fl ta Fl -tracker-add Ar tracker +Add a tracker to a torrent +.It Fl ta Fl -tracker-remove Ar trackerId +Remove a tracker from a torrent .It Fl s Fl -start Start the current torrent(s) .It Fl S Fl -stop