From 8bf7f71351e72136b3ea1af2b66091b69bc7566c Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 3 Apr 2024 16:31:36 +0200 Subject: [PATCH] ensure 100 download progress is sent --- tubearchivist/home/src/download/yt_dlp_handler.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tubearchivist/home/src/download/yt_dlp_handler.py b/tubearchivist/home/src/download/yt_dlp_handler.py index 6bf2c95..cb76ac3 100644 --- a/tubearchivist/home/src/download/yt_dlp_handler.py +++ b/tubearchivist/home/src/download/yt_dlp_handler.py @@ -177,7 +177,7 @@ class VideoDownloader: if not success: continue - self._notify(video_data, "Add video metadata to index") + self._notify(video_data, "Add video metadata to index", progress=1) vid_dict = index_new_video( youtube_id, @@ -197,14 +197,16 @@ class VideoDownloader: return self.videos - def _notify(self, video_data, message): + def _notify(self, video_data, message, progress=False): """send progress notification to task""" if not self.task: return typ = VideoTypeEnum(video_data["vid_type"]).value.rstrip("s").title() title = video_data.get("title") - self.task.send_progress([f"Processing {typ}: {title}", message]) + self.task.send_progress( + [f"Processing {typ}: {title}", message], progress=progress + ) def _get_next(self, auto_only): """get next item in queue"""