Cancel failed task before streaming.

livestream to be streamed, after realizing it was a livestream. This
however caused the youtube-dl extension to fail when downloading DRM
content after gpodder failed to download it, because the partial file
was missing.

This removes that fix and properly cancels the failed task before
streaming to remove the partial file.

Fixes #1147.
This commit is contained in:
auouymous 2021-10-11 20:11:18 -06:00
parent 263c4ad9fe
commit db2aa385d0
2 changed files with 5 additions and 4 deletions

View File

@ -953,10 +953,6 @@ class DownloadTask(object):
self.status = DownloadTask.FAILED
self.__episode._download_error = self.error_message
# Delete empty partial files, they prevent streaming after a download failure (live stream)
if util.calculate_size(self.filename) == 0:
util.delete_file(self.tempname)
# cancelled/paused -- update state to mark it as safe to manipulate this task again
elif self.status == DownloadTask.PAUSING:
self.status = DownloadTask.PAUSED

View File

@ -2125,6 +2125,11 @@ class gPodder(BuilderWidget, dbus.service.Object):
for episode in episodes:
episode._download_error = None
if episode.download_task is not None and episode.download_task.status == episode.download_task.FAILED:
# Cancel failed task and remove from progress list
episode.download_task.cancel()
self.cleanup_downloads()
player = self.episode_player(episode)
try: