Fix last by just always deleting the fastresume file before writing a
new one
This commit is contained in:
parent
deb00e332e
commit
e614c2dc3b
@ -605,6 +605,7 @@ class Torrent:
|
|||||||
self.torrent_id)
|
self.torrent_id)
|
||||||
log.debug("Saving fastresume file: %s", path)
|
log.debug("Saving fastresume file: %s", path)
|
||||||
try:
|
try:
|
||||||
|
self.delete_fastresume()
|
||||||
fastresume = open(path, "wb")
|
fastresume = open(path, "wb")
|
||||||
fastresume.write(resume_data)
|
fastresume.write(resume_data)
|
||||||
fastresume.close()
|
fastresume.close()
|
||||||
|
|||||||
@ -528,9 +528,7 @@ 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.write_fastresume()
|
||||||
torrent.delete_fastresume()
|
|
||||||
torrent.write_fastresume()
|
|
||||||
|
|
||||||
def queue_top(self, torrent_id):
|
def queue_top(self, torrent_id):
|
||||||
"""Queue torrent to top"""
|
"""Queue torrent to top"""
|
||||||
@ -618,9 +616,7 @@ 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].write_fastresume()
|
||||||
self.torrents[torrent_id].delete_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:
|
||||||
self.shutdown_torrent_pause_list.remove(torrent_id)
|
self.shutdown_torrent_pause_list.remove(torrent_id)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user