mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-17 13:56:47 +00:00
Improve get_torrent_status() speed by only building the files dictionary
when the Torrent object is created.
This commit is contained in:
parent
a3658e352b
commit
39e987d5da
@ -65,10 +65,13 @@ class Torrent:
|
|||||||
self.trackers.append(tracker)
|
self.trackers.append(tracker)
|
||||||
else:
|
else:
|
||||||
self.trackers = trackers
|
self.trackers = trackers
|
||||||
|
|
||||||
# Holds status info so that we don't need to keep getting it from lt
|
# Holds status info so that we don't need to keep getting it from lt
|
||||||
self.status = None
|
self.status = None
|
||||||
self.torrent_info = None
|
self.torrent_info = None
|
||||||
|
|
||||||
|
# Files dictionary
|
||||||
|
self.files = self.get_files()
|
||||||
|
|
||||||
def set_tracker_status(self, status):
|
def set_tracker_status(self, status):
|
||||||
"""Sets the tracker status"""
|
"""Sets the tracker status"""
|
||||||
@ -185,7 +188,7 @@ class Torrent:
|
|||||||
"trackers": self.trackers,
|
"trackers": self.trackers,
|
||||||
"tracker_status": self.tracker_status,
|
"tracker_status": self.tracker_status,
|
||||||
"save_path": self.save_path,
|
"save_path": self.save_path,
|
||||||
"files": self.get_files()
|
"files": self.files
|
||||||
}
|
}
|
||||||
self.status = None
|
self.status = None
|
||||||
self.torrent_info = None
|
self.torrent_info = None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user