Skip to content

Commit

Permalink
✨ Exception logging on filename sanitization and download watcher.
Browse files Browse the repository at this point in the history
  • Loading branch information
exislow committed Apr 22, 2024
1 parent c3519c5 commit 840f23d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion tidal_dl_ng/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,8 @@ def watcher_queue_download(self) -> None:
self.s_queue_download_item_finished.emit(item)
elif result == QueueDownloadStatus.Skipped:
self.s_queue_download_item_skipped.emit(item)
except:
except e:
logger_gui.error(e)
self.s_queue_download_item_failed.emit(item)
else:
time.sleep(2)
Expand Down
3 changes: 2 additions & 1 deletion tidal_dl_ng/helper/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ def path_file_sanitize(path_file: str, adapt: bool = False, uniquify: bool = Fal
filename_sanitized = filename_sanitized[: -len(file_suffix)] + file_suffix
except ValidationError as e:
# TODO: Implement proper exception handling and logging.
# print(e)
# Hacky stuff, since the sanitizing function does not shorten the filename somehow (bug?)
# TODO: Remove after pathvalidate update.
# If filename too long
Expand All @@ -218,6 +217,8 @@ def path_file_sanitize(path_file: str, adapt: bool = False, uniquify: bool = Fal
+ FILENAME_SANITIZE_PLACEHOLDER
+ file_extension
)
else:
print(e)

# Join path and filename
result: str = os.path.join(pathname_sanitized, filename_sanitized)
Expand Down

0 comments on commit 840f23d

Please sign in to comment.