Minor design update

This commit is contained in:
arabcoders 2025-09-14 22:15:43 +03:00
parent 2b669cc8c1
commit d48faed4f7
4 changed files with 15 additions and 10 deletions

View file

@ -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]:

View file

@ -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 = () => {

View file

@ -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,

View file

@ -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 */