Fixes for #367 : Don't store last_seen_complete and total_uploaded in state file

This commit is contained in:
Calum Lind 2014-01-17 19:12:54 +00:00
parent bcbeca4b8a
commit 0da6739f94
2 changed files with 0 additions and 14 deletions

View file

@ -154,9 +154,6 @@ class Torrent(object):
self.has_metadata = self.status.has_metadata
self.status_funcs = None
# Default total_uploaded to 0, this may be changed by the state
self.total_uploaded = 0
# Set the default options
self.options = TorrentOptions()
self.options.update(options)
@ -167,8 +164,6 @@ class Torrent(object):
# Load values from state if we have it
if state:
# This is for saving the total uploaded between sessions
self.total_uploaded = state.total_uploaded
# Set the trackers
self.set_trackers(state.trackers)
# Set the filename

View file

@ -66,7 +66,6 @@ class TorrentState:
def __init__(self,
torrent_id=None,
filename=None,
total_uploaded=0,
trackers=None,
compact=False,
paused=False,
@ -88,7 +87,6 @@ class TorrentState:
move_completed_path=None,
magnet=None,
time_added=-1,
last_seen_complete=0,
owner=None,
shared=False):
self.torrent_id = torrent_id
@ -661,15 +659,9 @@ class TorrentManager(component.Component):
if torrent.state == "Paused":
paused = True
torrent_status = torrent.get_status([
"total_uploaded",
"last_seen_complete"
], update=True)
torrent_state = TorrentState(
torrent.torrent_id,
torrent.filename,
torrent_status["total_uploaded"],
torrent.trackers,
torrent.options["compact_allocation"],
paused,
@ -691,7 +683,6 @@ class TorrentManager(component.Component):
torrent.options["move_completed_path"],
torrent.magnet,
torrent.time_added,
torrent_status["last_seen_complete"],
torrent.owner,
torrent.options["shared"]
)