summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Honz <exislow+github@gmail.com>2024-04-22 07:58:32 +0200
committerRobert Honz <exislow+github@gmail.com>2024-04-22 07:58:32 +0200
commit840f23d2529550337c96ac5cb1dd7cf3df0c6d93 (patch)
treea986d25d943c87d19f14ef5da796e0f169ba2461
parentc3519c54a5c3e6d431a40fdac87e8199bf7c520c (diff)
downloadtidal-dl-ng-840f23d2529550337c96ac5cb1dd7cf3df0c6d93.tar.gz
✨ Exception logging on filename sanitization and download watcher.
-rw-r--r--tidal_dl_ng/gui.py3
-rw-r--r--tidal_dl_ng/helper/path.py3
2 files changed, 4 insertions, 2 deletions
diff --git a/tidal_dl_ng/gui.py b/tidal_dl_ng/gui.py
index 748db98..9443fdb 100644
--- a/tidal_dl_ng/gui.py
+++ b/tidal_dl_ng/gui.py
@@ -810,7 +810,8 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
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)
diff --git a/tidal_dl_ng/helper/path.py b/tidal_dl_ng/helper/path.py
index b101b59..e6a162e 100644
--- a/tidal_dl_ng/helper/path.py
+++ b/tidal_dl_ng/helper/path.py
@@ -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
@@ -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)