diff --git a/libtransmission/torrent.c b/libtransmission/torrent.c index 3813c495d..02404675f 100644 --- a/libtransmission/torrent.c +++ b/libtransmission/torrent.c @@ -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); }