From bff0e3f8d5698b6284e87c42df62de6f4f9c2eb9 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Mon, 18 Feb 2008 00:50:12 +0000 Subject: [PATCH] Attempt fix fastresume saving issue. --- src/core.py | 6 +++++- src/interface.py | 5 ++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/core.py b/src/core.py index ec3fff8de..71b5e3210 100644 --- a/src/core.py +++ b/src/core.py @@ -732,8 +732,12 @@ Space:") + " " + nice_free) if event['event_type'] in self.event_callbacks: for callback in self.event_callbacks[event['event_type']]: callback(event) + + if event['event_type'] is self.constants['EVENT_TORRENT_PAUSED'] or \ + event['event_type'] is self.constants['EVENT_FINISHED_CHECKING']: + self.save_fastresume_data(event['unique_ID']) - if event['event_type'] is self.constants['EVENT_FINISHED']: + if event['event_type'] is self.constants['EVENT_FINISHED']: if event['message'] == "torrent has finished downloading": # Queue seeding torrent to bottom if needed diff --git a/src/interface.py b/src/interface.py index fdc580a78..0bd4c16f2 100644 --- a/src/interface.py +++ b/src/interface.py @@ -833,7 +833,8 @@ window, please enter your password")) torrent_state = self.manager.get_torrent_state(uid) if torrent_state["is_paused"]: try: - os.remove(self.manager.unique_IDs[uid].filename + ".fastresume") + if torrent_state["state"] != 6 or torrent_state["state"] != 7: + os.remove(self.manager.unique_IDs[uid].filename + ".fastresume") except: pass self.manager.set_user_pause(uid, False, True) @@ -849,8 +850,6 @@ window, please enter your password")) for uid in unique_ids: self.manager.set_user_pause(uid, True, True) torrent_state = self.manager.get_torrent_state(uid) - if torrent_state["is_paused"] == 0: - self.manager.save_fastresume_data(uid) self.update() except: pass