Delete empty partial files immediately after download failure.

This commit is contained in:
auouymous 2021-05-20 06:32:31 -06:00
parent 8904ff8a12
commit 5fc0871078
1 changed files with 4 additions and 0 deletions

View File

@ -901,6 +901,10 @@ class DownloadTask(object):
if 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)
if self.status == DownloadTask.DOWNLOADING:
# Everything went well - we're done
self.status = DownloadTask.DONE