From d40237134c57106cba6a6cb9de0eaa578ddc3ba3 Mon Sep 17 00:00:00 2001 From: ArabCoders Date: Mon, 30 Dec 2024 21:58:01 +0300 Subject: [PATCH] minor fixes --- app/library/DownloadQueue.py | 9 ++------- app/library/config.py | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/app/library/DownloadQueue.py b/app/library/DownloadQueue.py index 62d8bb3b..8407f729 100644 --- a/app/library/DownloadQueue.py +++ b/app/library/DownloadQueue.py @@ -257,9 +257,6 @@ class DownloadQueue: started = time.perf_counter() LOG.debug(f"extract_info: checking {url=}") - if not isinstance(self.config.ytdl_options, dict): - self.config.ytdl_options = {} - entry = await asyncio.wait_for( fut=asyncio.get_running_loop().run_in_executor( None, @@ -477,13 +474,11 @@ class DownloadQueue: self.done.put(value=entry) asyncio.create_task(self.emitter.completed(dl=entry.info.serialize()), name=f"notifier-d-{id}") - self.event.set() + if self.event: + self.event.set() def isDownloaded(self, url: str) -> tuple[bool, dict | None]: if not url or not self.config.keep_archive: return False, None - if not isinstance(self.config.ytdl_options, dict): - self.config.ytdl_options = {} - return isDownloaded(self.config.ytdl_options.get("download_archive", None), url) diff --git a/app/library/config.py b/app/library/config.py index c7891b90..ce4c1c36 100644 --- a/app/library/config.py +++ b/app/library/config.py @@ -60,7 +60,7 @@ class Config: # immutable config vars. version: str = APP_VERSION __instance = None - ytdl_options: dict | str = {} + ytdl_options: dict = {} tasks: list = [] new_version_available: bool = False ytdlp_version: str = YTDLP_VERSION