(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:
Charles Kerr
2010-05-11 13:36:21 +00:00
parent ad27c9d58e
commit 3ff784ad28
3 changed files with 85 additions and 79 deletions

View File

@@ -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;