Author: andar

Revision: 6056

Log:
        Fix possible TorrentFinishedEvents being emitted on startup for already 
completed torrents

Diff:
Modified: branches/1.2_RC/deluge/core/torrentmanager.py
===================================================================
--- branches/1.2_RC/deluge/core/torrentmanager.py       2009-12-21 19:41:31 UTC 
(rev 6055)
+++ branches/1.2_RC/deluge/core/torrentmanager.py       2009-12-23 01:28:33 UTC 
(rev 6056)
@@ -785,10 +785,10 @@
         total_download = 
torrent.get_status(["total_payload_download"])["total_payload_download"]
 
         # Move completed download to completed folder if needed
-        if not torrent.is_finished:
+        if not torrent.is_finished and total_download:
             move_path = None
 
-            if torrent.options["move_completed"] and total_download:
+            if torrent.options["move_completed"]:
                 move_path = torrent.options["move_completed_path"]
                 if torrent.options["download_location"] != move_path:
                     torrent.move_storage(move_path)

Modified: trunk/deluge/core/torrentmanager.py
===================================================================
--- trunk/deluge/core/torrentmanager.py 2009-12-21 19:41:31 UTC (rev 6055)
+++ trunk/deluge/core/torrentmanager.py 2009-12-23 01:28:33 UTC (rev 6056)
@@ -800,10 +800,10 @@
         total_download = 
torrent.get_status(["total_payload_download"])["total_payload_download"]
 
         # Move completed download to completed folder if needed
-        if not torrent.is_finished:
+        if not torrent.is_finished and total_download:
             move_path = None
 
-            if torrent.options["move_completed"] and total_download:
+            if torrent.options["move_completed"]:
                 move_path = torrent.options["move_completed_path"]
                 if torrent.options["download_location"] != move_path:
                     torrent.move_storage(move_path)


--

You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en.


Reply via email to