Merge pull request #211 from arabcoders/dev
Added indicator in the WebUI for when post-processing are running
This commit is contained in:
commit
19bdd84dd5
3 changed files with 21 additions and 2 deletions
|
|
@ -100,6 +100,8 @@ class Download:
|
||||||
|
|
||||||
def _postprocessor_hook(self, data: dict):
|
def _postprocessor_hook(self, data: dict):
|
||||||
if "MoveFiles" != data.get("postprocessor") or "finished" != data.get("status"):
|
if "MoveFiles" != data.get("postprocessor") or "finished" != data.get("status"):
|
||||||
|
dataDict = {k: v for k, v in data.items() if k in self._ytdlp_fields}
|
||||||
|
self.status_queue.put({"id": self.id, **dataDict, "status": "postprocessing"})
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.debug:
|
if self.debug:
|
||||||
|
|
@ -117,6 +119,7 @@ class Download:
|
||||||
params = (
|
params = (
|
||||||
YTDLPOpts.get_instance()
|
YTDLPOpts.get_instance()
|
||||||
.preset(self.preset)
|
.preset(self.preset)
|
||||||
|
.add({"break_on_existing": True})
|
||||||
.add(self.ytdl_opts, from_user=True)
|
.add(self.ytdl_opts, from_user=True)
|
||||||
.add(
|
.add(
|
||||||
{
|
{
|
||||||
|
|
@ -130,7 +133,6 @@ class Download:
|
||||||
"chapter": self.template_chapter,
|
"chapter": self.template_chapter,
|
||||||
},
|
},
|
||||||
"noprogress": True,
|
"noprogress": True,
|
||||||
"break_on_existing": True,
|
|
||||||
"ignoreerrors": False,
|
"ignoreerrors": False,
|
||||||
},
|
},
|
||||||
from_user=False,
|
from_user=False,
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import asyncio
|
import asyncio
|
||||||
|
import functools
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
|
@ -422,7 +423,15 @@ class DownloadQueue(metaclass=Singleton):
|
||||||
|
|
||||||
entry = await asyncio.wait_for(
|
entry = await asyncio.wait_for(
|
||||||
fut=asyncio.get_running_loop().run_in_executor(
|
fut=asyncio.get_running_loop().run_in_executor(
|
||||||
None, extract_info, yt_conf, url, bool(self.config.ytdl_debug)
|
None,
|
||||||
|
functools.partial(
|
||||||
|
extract_info,
|
||||||
|
config=yt_conf,
|
||||||
|
url=url,
|
||||||
|
debug=bool(self.config.ytdl_debug),
|
||||||
|
no_archive=False,
|
||||||
|
follow_redirect=True,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
timeout=self.config.extract_info_timeout,
|
timeout=self.config.extract_info_timeout,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -191,6 +191,10 @@ const setIcon = item => {
|
||||||
return 'fa-solid fa-circle-check';
|
return 'fa-solid fa-circle-check';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ('postprocessing' === item.status) {
|
||||||
|
return 'fa-solid fa-cog fa-spin';
|
||||||
|
}
|
||||||
|
|
||||||
if (null === item.status && true === config.paused) {
|
if (null === item.status && true === config.paused) {
|
||||||
return 'fa-solid fa-pause-circle';
|
return 'fa-solid fa-pause-circle';
|
||||||
}
|
}
|
||||||
|
|
@ -239,6 +243,10 @@ const updateProgress = (item) => {
|
||||||
return 'Paused';
|
return 'Paused';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ('postprocessing' === item.status) {
|
||||||
|
return 'Post-processors are running.';
|
||||||
|
}
|
||||||
|
|
||||||
if ('preparing' === item.status) {
|
if ('preparing' === item.status) {
|
||||||
return 'Preparing';
|
return 'Preparing';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue