diff --git a/deluge/core/torrent.py b/deluge/core/torrent.py index 7e14b6132..484feae75 100644 --- a/deluge/core/torrent.py +++ b/deluge/core/torrent.py @@ -35,7 +35,6 @@ """Internal Torrent class""" import os -import time import logging import re from urllib import unquote @@ -199,11 +198,6 @@ class Torrent(object): # This gets updated when get_tracker_host is called self.tracker_host = None - if state: - self.time_added = state.time_added - else: - self.time_added = time.time() - # Keep track of the owner if state: self.owner = state.owner @@ -249,7 +243,7 @@ class Torrent(object): del OPTIONS_FUNCS["prioritize_first_last_pieces"] for (key, value) in options.items(): - if OPTIONS_FUNCS.has_key(key): + if key in OPTIONS_FUNCS: OPTIONS_FUNCS[key](value) self.options.update(options) @@ -724,7 +718,7 @@ class Torrent(object): "state": lambda: self.state, "stop_at_ratio": lambda: self.options["stop_at_ratio"], "stop_ratio": lambda: self.options["stop_ratio"], - "time_added": lambda: self.time_added, + "time_added": lambda: self.status.added_time, "total_done": lambda: self.status.total_done, "total_payload_download": lambda: self.status.total_payload_download, "total_payload_upload": lambda: self.status.total_payload_upload, diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py index aa4bbb005..ba61055cd 100644 --- a/deluge/core/torrentmanager.py +++ b/deluge/core/torrentmanager.py @@ -86,7 +86,6 @@ class TorrentState: move_completed=False, move_completed_path=None, magnet=None, - time_added=-1, owner=None, shared=False, super_seeding=False @@ -97,7 +96,6 @@ class TorrentState: self.queue = queue self.is_finished = is_finished self.magnet = magnet - self.time_added = time_added self.owner = owner # Options @@ -693,7 +691,6 @@ class TorrentManager(component.Component): torrent.options["move_completed"], torrent.options["move_completed_path"], torrent.magnet, - torrent.time_added, torrent.owner, torrent.options["shared"], torrent.options["super_seeding"]