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:
* Fix add torrent dialog closing preventing another dialog from being shown
* 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)
Core:

View file

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