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 2cd39233da
commit deb00e332e
1 changed files with 6 additions and 2 deletions

View File

@ -528,7 +528,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"""
@ -616,7 +618,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)