Fix #2303 : Torrent state not updated until after emitting TorrentFinishedEvent
This commit is contained in:
parent
686fb31844
commit
5057e2caab
|
@ -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:
|
||||||
|
|
Loading…
Reference in New Issue