From deb00e332ecae7afed3e0ae4f6170a52213eb677 Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Sat, 6 Sep 2008 20:11:12 +0000 Subject: [PATCH] fix problem with old fastresume files not being replaced causing loss of data and dont resave fastresume for seed files --- deluge/core/torrentmanager.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py index fe8f20154..20c5d46c8 100644 --- a/deluge/core/torrentmanager.py +++ b/deluge/core/torrentmanager.py @@ -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)