mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-20 11:35:49 +00:00
Fix last by just always deleting the fastresume file before writing a
new one
This commit is contained in:
parent
4094601f6e
commit
67c0069c7a
2 changed files with 3 additions and 6 deletions
|
@ -544,6 +544,7 @@ class Torrent:
|
|||
self.torrent_id)
|
||||
log.debug("Saving fastresume file: %s", path)
|
||||
try:
|
||||
self.delete_fastresume()
|
||||
fastresume = open(path, "wb")
|
||||
fastresume.write(resume_data)
|
||||
fastresume.close()
|
||||
|
|
|
@ -563,9 +563,7 @@ class TorrentManager(component.Component):
|
|||
def save_resume_data(self):
|
||||
"""Saves resume data for all the torrents"""
|
||||
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):
|
||||
"""Queue torrent to top"""
|
||||
|
@ -647,9 +645,7 @@ class TorrentManager(component.Component):
|
|||
component.get("SignalManager").emit("torrent_paused", torrent_id)
|
||||
|
||||
# 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:
|
||||
self.shutdown_torrent_pause_list.remove(torrent_id)
|
||||
|
|
Loading…
Add table
Reference in a new issue