diff --git a/app/src/DataStore.py b/app/src/DataStore.py index 8827fa4d..fa450363 100644 --- a/app/src/DataStore.py +++ b/app/src/DataStore.py @@ -68,7 +68,7 @@ class DataStore: return items - def put(self, value: Download) -> None: + def put(self, value: Download) -> Download: for key in self.dict: if self.dict[key].info.url == value.info.url: value.info._id = key @@ -77,6 +77,8 @@ class DataStore: self.dict[value.info._id] = value self._updateStoreItem(self.type, value.info) + return self.dict[value.info._id] + def delete(self, key: str) -> None: if not key in self.dict: return diff --git a/app/src/DownloadQueue.py b/app/src/DownloadQueue.py index a2b3070d..3149db6a 100644 --- a/app/src/DownloadQueue.py +++ b/app/src/DownloadQueue.py @@ -125,19 +125,17 @@ class DownloadQueue: dl.output_template = dl.output_template.replace( f"%({property})s", str(value)) - self.queue.put( - Download( - info=dl, - download_dir=dldirectory, - temp_dir=self.config.temp_path, - output_template_chapter=output_chapter, - default_ytdl_opts=self.config.ytdl_options, - debug=bool(self.config.ytdl_debug) - ) - ) + itemDownload = self.queue.put(Download( + info=dl, + download_dir=dldirectory, + temp_dir=self.config.temp_path, + output_template_chapter=output_chapter, + default_ytdl_opts=self.config.ytdl_options, + debug=bool(self.config.ytdl_debug) + )) self.event.set() - await self.notifier.added(dl) + await self.notifier.added(itemDownload.info) return { 'status': 'ok' @@ -148,6 +146,9 @@ class DownloadQueue: quality=quality, format=format, folder=folder, + ytdlp_config=ytdlp_config, + ytdlp_cookies=ytdlp_cookies, + output_template=output_template, already=already )