Merge pull request #211 from arabcoders/dev

Added indicator in the WebUI for when post-processing are running
This commit is contained in:
Abdulmohsen 2025-03-15 01:33:55 +03:00 committed by GitHub
commit 19bdd84dd5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 21 additions and 2 deletions

View file

@ -100,6 +100,8 @@ class Download:
def _postprocessor_hook(self, data: dict):
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
if self.debug:
@ -117,6 +119,7 @@ class Download:
params = (
YTDLPOpts.get_instance()
.preset(self.preset)
.add({"break_on_existing": True})
.add(self.ytdl_opts, from_user=True)
.add(
{
@ -130,7 +133,6 @@ class Download:
"chapter": self.template_chapter,
},
"noprogress": True,
"break_on_existing": True,
"ignoreerrors": False,
},
from_user=False,

View file

@ -1,4 +1,5 @@
import asyncio
import functools
import json
import logging
import os
@ -422,7 +423,15 @@ class DownloadQueue(metaclass=Singleton):
entry = await asyncio.wait_for(
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,
)

View file

@ -191,6 +191,10 @@ const setIcon = item => {
return 'fa-solid fa-circle-check';
}
if ('postprocessing' === item.status) {
return 'fa-solid fa-cog fa-spin';
}
if (null === item.status && true === config.paused) {
return 'fa-solid fa-pause-circle';
}
@ -239,6 +243,10 @@ const updateProgress = (item) => {
return 'Paused';
}
if ('postprocessing' === item.status) {
return 'Post-processors are running.';
}
if ('preparing' === item.status) {
return 'Preparing';
}