Replace internal time_added with lt added_time

This commit is contained in:
Calum Lind 2014-01-18 20:59:42 +00:00
parent 246708e222
commit b5946c91ed
2 changed files with 2 additions and 11 deletions

View File

@ -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,

View File

@ -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"]