From ac959da229b61ec437b9d9909ee5854d70b7e65e Mon Sep 17 00:00:00 2001 From: Benex254 Date: Fri, 4 Oct 2024 19:42:04 +0300 Subject: [PATCH] feat: renable bg downloading function --- fastanime/Utility/downloader/downloader.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/fastanime/Utility/downloader/downloader.py b/fastanime/Utility/downloader/downloader.py index 3eb134a..7a226e2 100644 --- a/fastanime/Utility/downloader/downloader.py +++ b/fastanime/Utility/downloader/downloader.py @@ -174,8 +174,15 @@ class YtDLPDownloader: except Exception as e: print(f"[red bold]An error[/] occurred: {e}") - # WARN: May remove this legacy functionality - def download_file(self, url: str, title, silent=True): + def download_file( + self, + url: str, + anime_title: str, + episode_title: str, + download_dir: str, + silent: bool = True, + **kwargs, + ): """A helper that just does things in the background Args: @@ -183,7 +190,12 @@ class YtDLPDownloader: silent ([TODO:parameter]): [TODO:description] url: [TODO:description] """ - self.downloads_queue.put((self._download_file, (url, title, silent))) + self.downloads_queue.put( + ( + self._download_file, + (url, anime_title, episode_title, download_dir, silent), + ) + ) downloader = YtDLPDownloader()