mirror of
https://github.com/transmission/transmission.git
synced 2025-12-25 04:45:56 +00:00
(trunk) #1796 "run script after torrent completion" -- (1) add to transmission-remote. (2) remove cli's custom script handler and have it use libtransmission instead.
This commit is contained in:
13
cli/cli.c
13
cli/cli.c
@@ -47,7 +47,6 @@ static sig_atomic_t gotsig = 0;
|
||||
static sig_atomic_t manualUpdate = 0;
|
||||
|
||||
static const char * torrentPath = NULL;
|
||||
static const char * finishCall = NULL;
|
||||
static const char * sourceFile = NULL;
|
||||
static const char * comment = NULL;
|
||||
|
||||
@@ -137,14 +136,6 @@ escape( char * out,
|
||||
*out = '\0';
|
||||
}
|
||||
|
||||
static void
|
||||
torrentCompletenessChanged( tr_torrent * torrent UNUSED,
|
||||
tr_completeness completeness UNUSED,
|
||||
void * user_data UNUSED )
|
||||
{
|
||||
system( finishCall );
|
||||
}
|
||||
|
||||
static tr_bool waitingOnWeb;
|
||||
|
||||
static void
|
||||
@@ -453,7 +444,6 @@ main( int argc,
|
||||
#ifndef WIN32
|
||||
signal( SIGHUP, sigHandler );
|
||||
#endif
|
||||
tr_torrentSetCompletenessCallback( tor, torrentCompletenessChanged, NULL );
|
||||
tr_torrentStart( tor );
|
||||
|
||||
if( verify )
|
||||
@@ -548,7 +538,8 @@ parseCommandLine( tr_benc * d, int argc, const char ** argv )
|
||||
break;
|
||||
case 'D': tr_bencDictAddBool( d, TR_PREFS_KEY_DSPEED_ENABLED, FALSE );
|
||||
break;
|
||||
case 'f': finishCall = optarg;
|
||||
case 'f': tr_bencDictAddStr( d, TR_PREFS_KEY_SCRIPT_TORRENT_DONE_FILENAME, optarg );
|
||||
tr_bencDictAddBool( d, TR_PREFS_KEY_SCRIPT_TORRENT_DONE_ENABLED, TRUE );
|
||||
break;
|
||||
case 'g': /* handled above */
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user