From 7e4f564f4503f35fdabc00c79ff7aba30a2dac2e Mon Sep 17 00:00:00 2001 From: simon Date: Mon, 10 Apr 2023 10:25:09 +0700 Subject: [PATCH] fix title overwrite in notification --- tubearchivist/home/src/download/yt_dlp_handler.py | 11 +++++------ tubearchivist/home/tasks.py | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/tubearchivist/home/src/download/yt_dlp_handler.py b/tubearchivist/home/src/download/yt_dlp_handler.py index 13678d86..529526f0 100644 --- a/tubearchivist/home/src/download/yt_dlp_handler.py +++ b/tubearchivist/home/src/download/yt_dlp_handler.py @@ -131,13 +131,12 @@ class DownloadPostProcess: total_channel = len(self.download.channels) total_playlist = len(all_channel_playlist) - message = [f"Validate Playlists {id_p + 1}/{total_playlist}"] - title = f"Post Processing Channels: {id_c + 1}/{total_channel}" + message = [ + f"Post Processing Channels: {id_c}/{total_channel}", + f"Validate Playlists {id_p + 1}/{total_playlist}", + ] progress = (id_c + 1) / total_channel - - self.download.task.send_progress( - message, progress=progress, title=title - ) + self.download.task.send_progress(message, progress=progress) def get_comments(self): """get comments from youtube""" diff --git a/tubearchivist/home/tasks.py b/tubearchivist/home/tasks.py index a86c1dc1..21964689 100644 --- a/tubearchivist/home/tasks.py +++ b/tubearchivist/home/tasks.py @@ -146,7 +146,7 @@ class BaseTask(Task): def _build_message(self, level="info"): """build message dict""" 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}) task_result = TaskManager().get_task(task_id) if task_result: