From d7d1f52ff3077555d6269f3010cd1aead3bbec82 Mon Sep 17 00:00:00 2001 From: tcely Date: Fri, 7 Feb 2025 15:59:44 -0500 Subject: [PATCH] Completed fragments or bytes can be zero --- tubesync/sync/hooks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tubesync/sync/hooks.py b/tubesync/sync/hooks.py index 3c506eb7..faeeb81e 100644 --- a/tubesync/sync/hooks.py +++ b/tubesync/sync/hooks.py @@ -114,10 +114,10 @@ def yt_dlp_progress_hook(event): percent = int(float(percent_str.rstrip('%'))) except: pass - if fragment_index > 0 and fragment_count > 0: + if fragment_index >= 0 and fragment_count > 0: percent = round(100 * fragment_index / fragment_count) percent_str = f'{percent}%' - elif downloaded_bytes > 0 and total_bytes > 0: + elif downloaded_bytes >= 0 and total_bytes > 0: percent = round(100 * downloaded_bytes / total_bytes) if percent and (status.next_progress() < percent) and (0 == percent % 5): status.download_progress = percent