mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-27 10:30:41 +00:00
Fix saving ratios on quit.
This commit is contained in:
parent
3857a564a1
commit
efead335a9
11
src/core.py
11
src/core.py
@ -360,14 +360,13 @@ class Manager:
|
||||
|
||||
def pickle_state(self):
|
||||
print "save uploaded memory"
|
||||
for unique_ID in self.unique_IDs.keys():
|
||||
# self.get_core_torrent_state purposefully not cached.
|
||||
for torrent in self.state.torrents:
|
||||
uid = self.state.torrents[torrent]
|
||||
try:
|
||||
self.unique_IDs[unique_ID].uploaded_memory = \
|
||||
self.unique_IDs[unique_ID].initial_uploaded_memory + \
|
||||
self.get_core_torrent_state(unique_ID, False)['total_upload']
|
||||
torrent.uploaded_memory = self.unique_IDs[uid].uploaded_memory +\
|
||||
self.get_core_torrent_state(uid, False)['total_upload']
|
||||
except AttributeError:
|
||||
self.unique_IDs[unique_ID].initial_uploaded_memory = 0
|
||||
torrent.uploaded_memory = 0
|
||||
# Pickle the state so if we experience a crash, the latest state is
|
||||
# available
|
||||
print "Pickling state..."
|
||||
|
Loading…
x
Reference in New Issue
Block a user