From 2ecb54c4f7e528eb20a0c2adfb55b3b3891677b1 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Wed, 29 Feb 2012 02:56:01 +0000 Subject: [PATCH] Ensure is_finished value is correct after state changed alert Set torrent.is_finished to false when torrent is in a Checking or Downloading state --- deluge/core/torrentmanager.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py index effe76d78..25e87ab26 100644 --- a/deluge/core/torrentmanager.py +++ b/deluge/core/torrentmanager.py @@ -1064,6 +1064,11 @@ class TorrentManager(component.Component): old_state = torrent.state torrent.update_state() + + # Torrent may need to download data after checking. + if torrent.state in ('Checking', 'Checking Resume Data', 'Downloading'): + torrent.is_finished = False + # Only emit a state changed event if the state has actually changed if torrent.state != old_state: component.get("EventManager").emit(TorrentStateChangedEvent(torrent_id, torrent.state))