#5146 'seeding complete callback called twice': revert r13627 due to issues described in https://trac.transmissionbt.com/ticket/5146#comment:15

This commit is contained in:
Jordan Lee 2013-01-27 06:02:52 +00:00
parent 388da24dd0
commit 5f9e7f773b
1 changed files with 6 additions and 5 deletions

View File

@ -2028,20 +2028,18 @@ tr_torrentRecheckCompleteness (tr_torrent * tor)
completeness = tr_cpGetStatus (&tor->completion);
if (completeness != tor->completeness)
{
const int recentChange = tor->downloadedCur != 0;
const bool recentChange = tor->downloadedCur != 0;
const bool wasLeeching = !tr_torrentIsSeed (tor);
const bool wasRunning = tor->isRunning;
if (recentChange)
tr_logAddTorInfo (tor, _("State changed from \"%1$s\" to \"%2$s\""),
getCompletionString (tor->completeness),
getCompletionString (completeness));
getCompletionString (tor->completeness),
getCompletionString (completeness));
tor->completeness = completeness;
tr_fdTorrentClose (tor->session, tor->uniqueId);
fireCompletenessChange (tor, completeness, wasRunning);
if (tr_torrentIsSeed (tor))
{
if (recentChange)
@ -2066,6 +2064,9 @@ tr_torrentRecheckCompleteness (tr_torrent * tor)
torrentCallScript (tor, tr_sessionGetTorrentDoneScript (tor->session));
}
fireCompletenessChange (tor, completeness, wasRunning);
tr_torrentSetDirty (tor);
}