Skip to content

Commit

Permalink
Automatically remove failed files
Browse files Browse the repository at this point in the history
  • Loading branch information
justin025 committed Nov 7, 2024
1 parent 82a8919 commit b329a3c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/onthespot/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,10 @@ def run(self):
continue
except Exception as e:
logger.error(f"Unknown Exception: {str(e)}")
if os.path.exists(temp_file_path):
os.remove(temp_file_path)
if os.path.exists(file_path):
os.remove(file_path)
item['item_status'] = "Failed"
if self.gui:
self.progress.emit(item, self.tr("Failed"), 0)
Expand Down

0 comments on commit b329a3c

Please sign in to comment.