mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-04 23:48:40 +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
1 changed files with 5 additions and 2 deletions
|
@ -70,6 +70,9 @@ class Torrent:
|
||||||
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"""
|
||||||
self.tracker_status = status
|
self.tracker_status = 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…
Add table
Add a link
Reference in a new issue