From d48faed4f70ac6d2f09b149af9867e5f9780347a Mon Sep 17 00:00:00 2001 From: arabcoders Date: Sun, 14 Sep 2025 22:15:43 +0300 Subject: [PATCH] Minor design update --- app/library/DownloadQueue.py | 4 +++- ui/app/pages/index.vue | 16 ++++++++-------- ui/app/stores/ConfigStore.ts | 3 ++- ui/app/types/config.d.ts | 2 ++ 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/app/library/DownloadQueue.py b/app/library/DownloadQueue.py index b82e3363..06d5cd9f 100644 --- a/app/library/DownloadQueue.py +++ b/app/library/DownloadQueue.py @@ -156,7 +156,9 @@ class DownloadQueue(metaclass=Singleton): """ Initialize the download queue. """ - LOG.info(f"Using '{self.config.max_workers}' workers for downloading.") + LOG.info( + f"Using '{self.config.max_workers}' workers for downloading and '{self.config.max_workers_per_extractor}' per extractor." + ) asyncio.create_task(self._download_pool(), name="download_pool") async def start_items(self, ids: list[str]) -> dict[str, str]: diff --git a/ui/app/pages/index.vue b/ui/app/pages/index.vue index 3edf9907..a14fd5c1 100644 --- a/ui/app/pages/index.vue +++ b/ui/app/pages/index.vue @@ -117,29 +117,29 @@ watch(toggleFilter, () => { } }); -onMounted(() => { +const getTitle = (): string => { if (!config.app.ui_update_title) { - useHead({ title: 'YTPTube' }) - return + return 'YTPTube' } - useHead({ title: `YTPTube: ( ${Object.keys(stateStore.queue).length || 0}/${config.app.max_workers} | ${Object.keys(stateStore.history).length || 0} )` }) -}) + return `YTPTube: ( ${Object.keys(stateStore.queue).length || 0}/${config.app.max_workers}:${config.app.max_workers_per_extractor} | ${Object.keys(stateStore.history).length || 0} )` +} + +onMounted(() => useHead({ title: getTitle() })) watch(() => stateStore.history, () => { if (!config.app.ui_update_title) { return } - useHead({ title: `YTPTube: ( ${Object.keys(stateStore.queue).length || 0}/${config.app.max_workers} | ${Object.keys(stateStore.history).length || 0} )` }) + useHead({ title: getTitle() }) }, { deep: true }) watch(() => stateStore.queue, () => { if (!config.app.ui_update_title) { return } - useHead({ title: `YTPTube: ( ${Object.keys(stateStore.queue).length || 0}/${config.app.max_workers} | ${Object.keys(stateStore.history).length || 0} )` }) + useHead({ title: getTitle() }) }, { deep: true }) - const resumeDownload = async () => await request('/api/system/resume', { method: 'POST' }) const pauseDownload = () => { diff --git a/ui/app/stores/ConfigStore.ts b/ui/app/stores/ConfigStore.ts index c21c6bae..86ff8627 100644 --- a/ui/app/stores/ConfigStore.ts +++ b/ui/app/stores/ConfigStore.ts @@ -10,7 +10,8 @@ export const useConfigStore = defineStore('config', () => { ui_update_title: true, output_template: '', ytdlp_version: '', - max_workers: 1, + max_workers: 20, + max_workers_per_extractor: 2, default_preset: 'default', instance_title: null, console_enabled: false, diff --git a/ui/app/types/config.d.ts b/ui/app/types/config.d.ts index 5bf7beb6..91a10443 100644 --- a/ui/app/types/config.d.ts +++ b/ui/app/types/config.d.ts @@ -14,6 +14,8 @@ type AppConfig = { ytdlp_version: string /** Maximum number of concurrent download workers */ max_workers: number + /** Maximum number of concurrent workers per extractor */ + max_workers_per_extractor: number /** Default preset name, e.g. "default" */ default_preset: string /** Instance title for the app, null if not set */