fix title overwrite in notification

This commit is contained in:
simon 2023-04-10 10:25:09 +07:00
parent 3c8f7aeecf
commit 7e4f564f45
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4
2 changed files with 6 additions and 7 deletions

View File

@ -131,13 +131,12 @@ class DownloadPostProcess:
total_channel = len(self.download.channels) total_channel = len(self.download.channels)
total_playlist = len(all_channel_playlist) total_playlist = len(all_channel_playlist)
message = [f"Validate Playlists {id_p + 1}/{total_playlist}"] message = [
title = f"Post Processing Channels: {id_c + 1}/{total_channel}" f"Post Processing Channels: {id_c}/{total_channel}",
f"Validate Playlists {id_p + 1}/{total_playlist}",
]
progress = (id_c + 1) / total_channel progress = (id_c + 1) / total_channel
self.download.task.send_progress(message, progress=progress)
self.download.task.send_progress(
message, progress=progress, title=title
)
def get_comments(self): def get_comments(self):
"""get comments from youtube""" """get comments from youtube"""

View File

@ -146,7 +146,7 @@ class BaseTask(Task):
def _build_message(self, level="info"): def _build_message(self, level="info"):
"""build message dict""" """build message dict"""
task_id = self.request.id task_id = self.request.id
message = self.TASK_CONFIG.get(self.name) message = self.TASK_CONFIG.get(self.name).copy()
message.update({"level": level, "id": task_id}) message.update({"level": level, "id": task_id})
task_result = TaskManager().get_task(task_id) task_result = TaskManager().get_task(task_id)
if task_result: if task_result: