1
0
Fork 0
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:
Mitchell Livingston 2010-09-12 18:58:49 +00:00
parent e91700b1c8
commit b3c8ca4604
2 changed files with 6 additions and 2 deletions

View file

@ -435,6 +435,7 @@ tr_torrentCheckSeedLimit( tr_torrent * tor )
tr_torinf( tor, "Seeding idle limit reached; pausing torrent" );
tor->isStopping = TRUE;
tor->finishedSeedingByIdle = TRUE;
/* maybe notify the client */
if( tor->idle_limit_hit_func != NULL )
@ -771,6 +772,8 @@ torrentInit( tr_torrent * tor, const tr_ctor * ctor )
tor->error = TR_STAT_OK;
tor->finishedSeedingByIdle = FALSE;
tr_peerMgrAddTorrent( session->peerMgr, tor );
assert( !tor->downloadedCur );
@ -1199,10 +1202,9 @@ tr_torrentStat( tr_torrent * tor )
break;
}
#warning (maybe) do something for idle?
/* s->haveValid is here to make sure a torrent isn't marked 'finished'
* 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 )
s->seedRatioPercentDone = 1;
@ -1492,6 +1494,7 @@ checkAndStartImpl( void * vtor )
tor->completeness = tr_cpGetStatus( &tor->completion );
tor->startDate = tor->anyDate = now;
tr_torrentClearError( tor );
tor->finishedSeedingByIdle = FALSE;
tr_torrentResetTransferStats( tor );
tr_announcerTorrentStarted( tor );

View file

@ -260,6 +260,7 @@ struct tr_torrent
uint16_t idleLimitMinutes;
tr_idlelimit idleLimitMode;
tr_bool finishedSeedingByIdle;
uint64_t preVerifyTotal;
};