Changeset 10640 for trunk/cli/cli.c


Ignore:
Timestamp:
May 11, 2010, 1:36:21 PM (12 years ago)
Author:
charles
Message:

(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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cli/cli.c

    r10536 r10640  
    4848
    4949static const char * torrentPath  = NULL;
    50 static const char * finishCall   = NULL;
    5150static const char * sourceFile   = NULL;
    5251static const char * comment      = NULL;
     
    138137}
    139138
    140 static void
    141 torrentCompletenessChanged( tr_torrent       * torrent       UNUSED,
    142                             tr_completeness    completeness  UNUSED,
    143                             void             * user_data     UNUSED )
    144 {
    145     system( finishCall );
    146 }
    147 
    148139static tr_bool waitingOnWeb;
    149140
     
    454445    signal( SIGHUP, sigHandler );
    455446#endif
    456     tr_torrentSetCompletenessCallback( tor, torrentCompletenessChanged, NULL );
    457447    tr_torrentStart( tor );
    458448
     
    549539            case 'D': tr_bencDictAddBool( d, TR_PREFS_KEY_DSPEED_ENABLED, FALSE );
    550540                      break;
    551             case 'f': finishCall = optarg;
     541            case 'f': tr_bencDictAddStr( d, TR_PREFS_KEY_SCRIPT_TORRENT_DONE_FILENAME, optarg );
     542                      tr_bencDictAddBool( d, TR_PREFS_KEY_SCRIPT_TORRENT_DONE_ENABLED, TRUE );
    552543                      break;
    553544            case 'g': /* handled above */
Note: See TracChangeset for help on using the changeset viewer.