ensure 100 download progress is sent
This commit is contained in:
parent
a72be27982
commit
8bf7f71351
|
@ -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"""
|
||||
|
|
Loading…
Reference in New Issue