Fix #2303 : Torrent state not updated until after emitting TorrentFinishedEvent

This commit is contained in:
Calum Lind 2013-05-22 23:15:55 +01:00
parent 686fb31844
commit 5057e2caab
1 changed files with 5 additions and 3 deletions

View File

@ -896,10 +896,12 @@ class TorrentManager(component.Component):
if torrent.options["download_location"] != move_path: if torrent.options["download_location"] != move_path:
torrent.move_storage(move_path) torrent.move_storage(move_path)
component.get("EventManager").emit(TorrentFinishedEvent(torrent_id))
torrent.is_finished = True
torrent.update_state() 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 # Torrent is no longer part of the queue
try: try: