summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCalum Lind <calumlind+deluge@gmail.com>2013-05-22 23:15:55 +0100
committerCalum Lind <calumlind+deluge@gmail.com>2013-05-22 23:18:01 +0100
commit5057e2caab9957e8119e3e1a4a0ce83126caef29 (patch)
tree1a0349139d7bc0940bb6681c7d978ace51e339f0
parent686fb3184480527d81ecc2e399b24ae676e7a1e8 (diff)
downloaddeluge-5057e2caab9957e8119e3e1a4a0ce83126caef29.tar.gz
deluge-5057e2caab9957e8119e3e1a4a0ce83126caef29.tar.bz2
deluge-5057e2caab9957e8119e3e1a4a0ce83126caef29.zip
Fix #2303 : Torrent state not updated until after emitting TorrentFinishedEvent
-rw-r--r--deluge/core/torrentmanager.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py
index 6254ffe59..8aa2503f7 100644
--- a/deluge/core/torrentmanager.py
+++ b/deluge/core/torrentmanager.py
@@ -896,10 +896,12 @@ class TorrentManager(component.Component):
if torrent.options["download_location"] != move_path:
torrent.move_storage(move_path)
- component.get("EventManager").emit(TorrentFinishedEvent(torrent_id))
-
- torrent.is_finished = True
torrent.update_state()
+ if not torrent.is_finished and total_download:
+ torrent.is_finished = True
+ component.get("EventManager").emit(TorrentFinishedEvent(torrent_id))
+ else:
+ torrent.is_finished = True
# Torrent is no longer part of the queue
try: