From 837de278b26d8e759f668bc188ceb6da6ce74166 Mon Sep 17 00:00:00 2001 From: arabcoders Date: Fri, 2 Jan 2026 19:55:18 +0300 Subject: [PATCH] Refactor: change ignore download message --- app/library/DownloadQueue.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/library/DownloadQueue.py b/app/library/DownloadQueue.py index 11599fd4..795a201e 100644 --- a/app/library/DownloadQueue.py +++ b/app/library/DownloadQueue.py @@ -863,8 +863,7 @@ class DownloadQueue(metaclass=Singleton): if not item.requeued and (condition := Conditions.get_instance().match(info=entry)): already.pop() - item_title = entry.get("title") or entry.get("id") or item.url - message = f"Condition '{condition.name}' matched for '{item_title}'." + message = f"Condition '{condition.name}' matched for '{item!r}'." if condition.cli: message += f" Re-queuing with '{condition.cli}'." @@ -873,18 +872,19 @@ class DownloadQueue(metaclass=Singleton): if condition.extras.get("ignore_download", False): extra_msg: str = "" - if yt_conf.get("download_archive") and not condition.extras.get("no_archive", False): - archive_add(yt_conf.get("download_archive"), [archive_id]) - extra_msg = f" and added to archive '{yt_conf.get('download_archive')}'" + if _archive_file and not condition.extras.get("no_archive", False): + archive_add(_archive_file, [archive_id]) + extra_msg = f" and added to archive file '{_archive_file}'" - log_message = f"Ignoring download of '{item_title}' as per condition '{condition.name}'{extra_msg}." + _name = entry.get("title", entry.get("id")) + log_message = f"Ignoring download of '{_name!r}' as per condition '{condition.name}'{extra_msg}." store_type, _ = await self.get_item(archive_id=archive_id) if not store_type: dlInfo = Download( info=ItemDTO( id=entry.get("id"), - title=item_title, + title=_name, url=item.url, preset=item.preset, folder=item.folder, @@ -909,7 +909,7 @@ class DownloadQueue(metaclass=Singleton): if condition.extras.get("set_preset") and (target_preset := condition.extras.get("set_preset")): if Presets.get_instance().has(target_preset): - log_message: str = f"Switching preset from '{item.preset}' to '{target_preset}' for '{item_title}' as per condition '{condition.name}'." + log_message: str = f"Switching preset from '{item.preset}' to '{target_preset}' for '{item!r}' as per condition '{condition.name}'." LOG.info(log_message) self._notify.emit(Events.LOG_INFO, data={}, title="Preset Switched", message=log_message) item = item.new_with(preset=target_preset)