#1869 Move the finished state to libtransmission. This setting is now remembered between launches. This also causes torrents that hit the seed ratio to not have this setting changed to unlimited until start.

This commit is contained in:
Mitchell Livingston
2010-04-02 17:57:25 +00:00
parent 01ae1dbe37
commit 6a4954e867
8 changed files with 35 additions and 20 deletions
+7 -2
View File
@@ -30,6 +30,9 @@
#include "version.h"
#include "web.h"
#define RPC_VERSION 9
#define RPC_VERSION_MIN 1
#define RECENTLY_ACTIVE_SECONDS 60
#define TR_N_ELEMENTS( ary ) ( sizeof( ary ) / sizeof( *ary ) )
@@ -502,6 +505,8 @@ addField( const tr_torrent * tor, tr_benc * d, const char * key )
tr_bencDictAddBool( d, key, tr_torrentUsesSessionLimits( tor ) );
else if( tr_streq( key, keylen, "id" ) )
tr_bencDictAddInt( d, key, st->id );
else if( tr_streq( key, keylen, "isFinished" ) )
tr_bencDictAddBool( d, key, st->finished );
else if( tr_streq( key, keylen, "isPrivate" ) )
tr_bencDictAddBool( d, key, tr_torrentIsPrivate( tor ) );
else if( tr_streq( key, keylen, "leftUntilDone" ) )
@@ -1306,8 +1311,8 @@ sessionGet( tr_session * s,
tr_bencDictAddInt ( d, TR_PREFS_KEY_PEER_PORT_RANDOM_ON_START, tr_sessionGetPeerPortRandomOnStart( s ) );
tr_bencDictAddBool( d, TR_PREFS_KEY_PORT_FORWARDING, tr_sessionIsPortForwardingEnabled( s ) );
tr_bencDictAddBool( d, TR_PREFS_KEY_RENAME_PARTIAL_FILES, tr_sessionIsIncompleteFileNamingEnabled( s ) );
tr_bencDictAddInt ( d, "rpc-version", 8 );
tr_bencDictAddInt ( d, "rpc-version-minimum", 1 );
tr_bencDictAddInt ( d, "rpc-version", RPC_VERSION );
tr_bencDictAddInt ( d, "rpc-version-minimum", RPC_VERSION_MIN );
tr_bencDictAddReal( d, "seedRatioLimit", tr_sessionGetRatioLimit( s ) );
tr_bencDictAddBool( d, "seedRatioLimited", tr_sessionIsRatioLimited( s ) );
tr_bencDictAddBool( d, TR_PREFS_KEY_START, !tr_sessionGetPaused( s ) );