Fixes
This commit is contained in:
parent
6bc50a3bc0
commit
58f1bd24f2
2 changed files with 15 additions and 12 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue