From d6e619c41313638467a16eabb82a9fd00d33c3b7 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Thu, 30 Jun 2011 22:33:19 +0100 Subject: [PATCH] Add session_started to determine if TorrentAddedEvent is from state file --- deluge/core/torrentmanager.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py index cd550482d..a13c9dc8d 100644 --- a/deluge/core/torrentmanager.py +++ b/deluge/core/torrentmanager.py @@ -149,6 +149,9 @@ class TorrentManager(component.Component): # Keeps track of resume data that needs to be saved to disk self.resume_data = {} + + # Workaround to determine if TorrentAddedEvent is from state file + self.session_started = False # Register set functions self.config.register_set_function("max_connections_per_torrent", @@ -631,6 +634,7 @@ class TorrentManager(component.Component): log.error("Torrent state file is either corrupt or incompatible! %s", e) break + self.session_started = True component.get("EventManager").emit(SessionStartedEvent()) def save_state(self):