fix problem with old fastresume files not being replaced causing loss of data and dont resave fastresume for seed files

This commit is contained in:
Marcos Pinto 2008-09-06 20:11:12 +00:00
parent 3178582312
commit 4094601f6e
2 changed files with 7 additions and 2 deletions

View File

@ -2,6 +2,7 @@ Deluge 0.9.09 - "1.0.0_RC9" (In Development)
GtkUI: GtkUI:
* Fix add torrent dialog closing preventing another dialog from being shown * Fix add torrent dialog closing preventing another dialog from being shown
* Fix various issues when not using English * Fix various issues when not using English
* Fix fastresume issue causing loss of data
Deluge 0.9.08 - "1.0.0_RC8" (27 August 2008) Deluge 0.9.08 - "1.0.0_RC8" (27 August 2008)
Core: Core:

View File

@ -563,6 +563,8 @@ class TorrentManager(component.Component):
def save_resume_data(self): def save_resume_data(self):
"""Saves resume data for all the torrents""" """Saves resume data for all the torrents"""
for torrent in self.torrents.values(): for torrent in self.torrents.values():
if not torrent.is_finished:
torrent.delete_fastresume()
torrent.write_fastresume() torrent.write_fastresume()
def queue_top(self, torrent_id): def queue_top(self, torrent_id):
@ -645,6 +647,8 @@ class TorrentManager(component.Component):
component.get("SignalManager").emit("torrent_paused", torrent_id) component.get("SignalManager").emit("torrent_paused", torrent_id)
# Write the fastresume file # Write the fastresume file
if not self.torrents[torrent_id].is_finished:
self.torrents[torrent_id].delete_fastresume()
self.torrents[torrent_id].write_fastresume() self.torrents[torrent_id].write_fastresume()
if torrent_id in self.shutdown_torrent_pause_list: if torrent_id in self.shutdown_torrent_pause_list: