diff options
| author | Robert Honz <exislow+github@gmail.com> | 2024-01-15 21:55:51 +0100 |
|---|---|---|
| committer | Robert Honz <exislow+github@gmail.com> | 2024-01-15 21:55:51 +0100 |
| commit | 1ca44af435be703d289a297af0b1ce376a2cc122 (patch) | |
| tree | 9bd1bc2c6eb83dcf5c7e9599423dcf27a1896ec4 /tidal_dl_ng/download.py | |
| parent | acf2ff3adbea589cd87747cf249cc1c55a64c41c (diff) | |
| download | tidal-dl-ng-1ca44af435be703d289a297af0b1ce376a2cc122.tar.gz | |
🛠️ Fixed GUI crashes. Root Cause: QProgressBar setValue() calls from download thread. Fixes #2.
Diffstat (limited to 'tidal_dl_ng/download.py')
| -rw-r--r-- | tidal_dl_ng/download.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/tidal_dl_ng/download.py b/tidal_dl_ng/download.py index fc7758e..949734c 100644 --- a/tidal_dl_ng/download.py +++ b/tidal_dl_ng/download.py @@ -69,6 +69,7 @@ class Download: progress_stdout: bool = True else: progress_stdout: bool = False + # Send signal to GUI with media name progress_gui.item_name.emit(media_name) try: @@ -113,8 +114,7 @@ class Download: # To send the progress to the GUI, we need to emit the percentage. if not progress_stdout: - # progress_gui.item.emit(progress.tasks[p_task].percentage) - pass + progress_gui.item.emit(progress.tasks[p_task].percentage) except HTTPError as e: # TODO: Handle Exception... fn_logger(e) @@ -240,8 +240,8 @@ class Download: release_date: str = ( track.album.release_date.strftime("%Y-%m-%d") if track.album and track.album.release_date else "" ) - copy_right: str = track.copyright if hasattr(track, "copyright") else "" - isrc: str = track.isrc if hasattr(track, "isrc") else "" + copy_right: str = track.copyright if hasattr(track, "copyright") and track.copyright else "" + isrc: str = track.isrc if hasattr(track, "isrc") and track.isrc else "" lyrics: str = "" if self.settings.data.lyrics_save: @@ -341,8 +341,7 @@ class Download: progress.advance(p_task1) if not progress_stdout: - # progress_gui.list_item.emit(progress.tasks[p_task1].percentage) - pass + progress_gui.list_item.emit(progress.tasks[p_task1].percentage) # If a file was downloaded and the download delay is enabled, wait until the next download. if download_delay and status_download: |
