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

View file

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