Skip to content

Commit 8f69610

Browse files
author
cfp
committed
revert 14136, correct fix for "queued torrents' state changes to paused when restarting transmission"
1 parent cbdb80a commit 8f69610

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

libtransmission/resume.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ tr_torrentSaveResume( tr_torrent * tor )
672672
tr_bencDictAddInt( &top, KEY_UPLOADED, tor->uploadedPrev + tor->uploadedCur );
673673
tr_bencDictAddInt( &top, KEY_MAX_PEERS, tor->maxConnectedPeers );
674674
tr_bencDictAddInt( &top, KEY_BANDWIDTH_PRIORITY, tr_torrentGetPriority( tor ) );
675-
tr_bencDictAddBool( &top, KEY_PAUSED, !tor->isRunning );
675+
tr_bencDictAddBool( &top, KEY_PAUSED, !tor->isRunning && !tor->isQueued );
676676
savePeers( &top, tor );
677677
if( tr_torrentHasMetadata( tor ) )
678678
{
@@ -780,7 +780,7 @@ loadFromFile( tr_torrent * tor, uint64_t fieldsToLoad )
780780
if( ( fieldsToLoad & TR_FR_RUN )
781781
&& tr_bencDictFindBool( &top, KEY_PAUSED, &boolVal ) )
782782
{
783-
tor->isRunning = !boolVal && !tor->isQueued;
783+
tor->isRunning = !boolVal;
784784
fieldsLoaded |= TR_FR_RUN;
785785
}
786786

libtransmission/torrent.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1952,7 +1952,6 @@ stopTorrent( void * vtor )
19521952

19531953
tr_verifyRemove( tor );
19541954
const bool wasQueued = tr_torrentIsQueued( tor );
1955-
torrentSetQueued( tor, false );
19561955
tr_peerMgrStopTorrent( tor );
19571956

19581957
if( !wasQueued )
@@ -1965,6 +1964,8 @@ stopTorrent( void * vtor )
19651964
if( !tor->isDeleting )
19661965
tr_torrentSave( tor );
19671966

1967+
torrentSetQueued( tor, false );
1968+
19681969
tr_torrentUnlock( tor );
19691970
}
19701971

@@ -3799,6 +3800,7 @@ torrentSetQueued( tr_torrent * tor, bool queued )
37993800
{
38003801
tor->isQueued = queued;
38013802
tor->anyDate = tr_time( );
3803+
tr_torrentSetDirty( tor );
38023804
}
38033805
}
38043806

0 commit comments

Comments
 (0)