From 39e987d5da9c489960b15efa7bd7eb2633eaf70f Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Wed, 2 Jan 2008 11:54:42 +0000 Subject: [PATCH] Improve get_torrent_status() speed by only building the files dictionary when the Torrent object is created. --- deluge/core/torrent.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/deluge/core/torrent.py b/deluge/core/torrent.py index 8d1505122..4ac0c7bca 100644 --- a/deluge/core/torrent.py +++ b/deluge/core/torrent.py @@ -65,10 +65,13 @@ class Torrent: self.trackers.append(tracker) else: self.trackers = trackers - + # Holds status info so that we don't need to keep getting it from lt self.status = None self.torrent_info = None + + # Files dictionary + self.files = self.get_files() def set_tracker_status(self, status): """Sets the tracker status""" @@ -185,7 +188,7 @@ class Torrent: "trackers": self.trackers, "tracker_status": self.tracker_status, "save_path": self.save_path, - "files": self.get_files() + "files": self.files } self.status = None self.torrent_info = None