mirror of
https://github.com/transmission/transmission
synced 2025-03-12 07:03:44 +00:00
#3513 inactive limit should set torrent state as finished, not stopped
This commit is contained in:
parent
e91700b1c8
commit
b3c8ca4604
2 changed files with 6 additions and 2 deletions
|
@ -435,6 +435,7 @@ tr_torrentCheckSeedLimit( tr_torrent * tor )
|
||||||
tr_torinf( tor, "Seeding idle limit reached; pausing torrent" );
|
tr_torinf( tor, "Seeding idle limit reached; pausing torrent" );
|
||||||
|
|
||||||
tor->isStopping = TRUE;
|
tor->isStopping = TRUE;
|
||||||
|
tor->finishedSeedingByIdle = TRUE;
|
||||||
|
|
||||||
/* maybe notify the client */
|
/* maybe notify the client */
|
||||||
if( tor->idle_limit_hit_func != NULL )
|
if( tor->idle_limit_hit_func != NULL )
|
||||||
|
@ -770,6 +771,8 @@ torrentInit( tr_torrent * tor, const tr_ctor * ctor )
|
||||||
tor->bandwidth->priority = tr_ctorGetBandwidthPriority( ctor );
|
tor->bandwidth->priority = tr_ctorGetBandwidthPriority( ctor );
|
||||||
|
|
||||||
tor->error = TR_STAT_OK;
|
tor->error = TR_STAT_OK;
|
||||||
|
|
||||||
|
tor->finishedSeedingByIdle = FALSE;
|
||||||
|
|
||||||
tr_peerMgrAddTorrent( session->peerMgr, tor );
|
tr_peerMgrAddTorrent( session->peerMgr, tor );
|
||||||
|
|
||||||
|
@ -1199,10 +1202,9 @@ tr_torrentStat( tr_torrent * tor )
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
#warning (maybe) do something for idle?
|
|
||||||
/* s->haveValid is here to make sure a torrent isn't marked 'finished'
|
/* s->haveValid is here to make sure a torrent isn't marked 'finished'
|
||||||
* when the user hits "uncheck all" prior to starting the torrent... */
|
* when the user hits "uncheck all" prior to starting the torrent... */
|
||||||
s->finished = seedRatioApplies && !seedRatioBytesLeft && s->haveValid;
|
s->finished = tor->finishedSeedingByIdle || (seedRatioApplies && !seedRatioBytesLeft && s->haveValid);
|
||||||
|
|
||||||
if( !seedRatioApplies || s->finished )
|
if( !seedRatioApplies || s->finished )
|
||||||
s->seedRatioPercentDone = 1;
|
s->seedRatioPercentDone = 1;
|
||||||
|
@ -1492,6 +1494,7 @@ checkAndStartImpl( void * vtor )
|
||||||
tor->completeness = tr_cpGetStatus( &tor->completion );
|
tor->completeness = tr_cpGetStatus( &tor->completion );
|
||||||
tor->startDate = tor->anyDate = now;
|
tor->startDate = tor->anyDate = now;
|
||||||
tr_torrentClearError( tor );
|
tr_torrentClearError( tor );
|
||||||
|
tor->finishedSeedingByIdle = FALSE;
|
||||||
|
|
||||||
tr_torrentResetTransferStats( tor );
|
tr_torrentResetTransferStats( tor );
|
||||||
tr_announcerTorrentStarted( tor );
|
tr_announcerTorrentStarted( tor );
|
||||||
|
|
|
@ -260,6 +260,7 @@ struct tr_torrent
|
||||||
|
|
||||||
uint16_t idleLimitMinutes;
|
uint16_t idleLimitMinutes;
|
||||||
tr_idlelimit idleLimitMode;
|
tr_idlelimit idleLimitMode;
|
||||||
|
tr_bool finishedSeedingByIdle;
|
||||||
|
|
||||||
uint64_t preVerifyTotal;
|
uint64_t preVerifyTotal;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue