diff options
| author | Robert Honz <exislow+github@gmail.com> | 2025-10-06 13:36:29 +0200 |
|---|---|---|
| committer | Robert Honz <exislow+github@gmail.com> | 2025-10-06 13:36:29 +0200 |
| commit | 768ca6db9cbf35167efb96d3e0254b176aa01989 (patch) | |
| tree | c0de3ea18d02efbdc4f84fff1aa338d97ad54118 | |
| parent | 49fd7a100f82fc0f6ad57b7d00b44f3610cdf6a9 (diff) | |
| download | tidal-dl-ng-768ca6db9cbf35167efb96d3e0254b176aa01989.tar.gz | |
fix(download): 🐛 handle empty items list in download process
* Added a check for empty `items` list to mark progress as complete.
* Ensured GUI updates correctly reflect progress for empty downloads.
| -rw-r--r-- | tidal_dl_ng/download.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tidal_dl_ng/download.py b/tidal_dl_ng/download.py index f02e096..8ca70c1 100644 --- a/tidal_dl_ng/download.py +++ b/tidal_dl_ng/download.py @@ -1366,6 +1366,16 @@ class Download: """ result_dirs: list[pathlib.Path] = [] + # Check if items list is empty + if not items: + # Mark progress as complete for empty lists + progress.update(progress_task, completed=progress.tasks[progress_task].total) + + if not progress_stdout and self.progress_gui: + self.progress_gui.list_item.emit(100.0) + + return result_dirs + # Iterate through list items while not progress.finished: with futures.ThreadPoolExecutor(max_workers=self.settings.data.downloads_concurrent_max) as executor: |
