From ef338f01242ccdfe34a6c21c94d21ec0dd4f8698 Mon Sep 17 00:00:00 2001 From: Andy Date: Sat, 31 Jan 2026 20:00:30 -0700 Subject: [PATCH] fix(downloader): correct progress bar tracking for segmented downloads Use segmented=True when downloading multiple URLs to prevent inner downloads from overriding the total segment count, which caused the progress bar to always appear green (finished state). This is still WIP so will continue to monitor. --- unshackle/core/downloaders/requests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unshackle/core/downloaders/requests.py b/unshackle/core/downloaders/requests.py index 06cab3d..cb3ce5a 100644 --- a/unshackle/core/downloaders/requests.py +++ b/unshackle/core/downloaders/requests.py @@ -122,7 +122,7 @@ def download( last_speed_refresh = now download_sizes.clear() - if content_length and written < content_length: + if not segmented and content_length and written < content_length: raise IOError(f"Failed to read {content_length} bytes from the track URI.") yield dict(file_downloaded=save_path, written=written) @@ -264,7 +264,7 @@ def requests( try: with ThreadPoolExecutor(max_workers=max_workers) as pool: - for future in as_completed(pool.submit(download, session=session, segmented=False, **url) for url in urls): + for future in as_completed(pool.submit(download, session=session, segmented=True, **url) for url in urls): try: yield from future.result() except KeyboardInterrupt: