From 94625c48b2cec7e8f09f1424a24a42163bf9988a Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Wed, 25 Nov 2009 01:55:51 +0000 Subject: [PATCH] Fix loading the saved metadata when loading state with magnet uris --- deluge/core/torrentmanager.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py index c9d69f487..108d27e8e 100644 --- a/deluge/core/torrentmanager.py +++ b/deluge/core/torrentmanager.py @@ -350,17 +350,16 @@ class TorrentManager(component.Component): options["move_completed_path"] = state.move_completed_path options["add_paused"] = state.paused - if not state.magnet: - add_torrent_params["ti"] =\ - self.get_torrent_info_from_file( - os.path.join(get_config_dir(), - "state", state.torrent_id + ".torrent")) - - if not add_torrent_params["ti"]: - log.error("Unable to add torrent!") - return - else: + ti = self.get_torrent_info_from_file( + os.path.join(get_config_dir(), + "state", state.torrent_id + ".torrent")) + if ti: + add_torrent_params["ti"] = ti + elif state.magnet: magnet = state.magnet + else: + log.error("Unable to add torrent!") + return # Handle legacy case with storing resume data in individual files # for each torrent