ensure 100 download progress is sent

pull/697/head
Simon 2 months ago
parent a72be27982
commit 8bf7f71351
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4

@ -177,7 +177,7 @@ class VideoDownloader:
if not success: if not success:
continue 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( vid_dict = index_new_video(
youtube_id, youtube_id,
@ -197,14 +197,16 @@ class VideoDownloader:
return self.videos return self.videos
def _notify(self, video_data, message): def _notify(self, video_data, message, progress=False):
"""send progress notification to task""" """send progress notification to task"""
if not self.task: if not self.task:
return return
typ = VideoTypeEnum(video_data["vid_type"]).value.rstrip("s").title() typ = VideoTypeEnum(video_data["vid_type"]).value.rstrip("s").title()
title = video_data.get("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): def _get_next(self, auto_only):
"""get next item in queue""" """get next item in queue"""

Loading…
Cancel
Save