Added maxWorkers to title

This commit is contained in:
ArabCoders 2024-12-30 10:51:14 +03:00
parent 1bcad666be
commit 448a145ed0
3 changed files with 6 additions and 4 deletions

View file

@ -159,6 +159,7 @@ class Config:
"url_prefix",
"remove_files",
"ui_update_title",
"max_workers",
)
@staticmethod

View file

@ -8,28 +8,28 @@
<script setup>
const config = useConfigStore()
const stateStore = useStateStore()
const maxWorkers = config.app.max_workers
onMounted(() => {
if (!config.app.ui_update_title) {
useHead({ title: 'YTPTube' })
return
}
useHead({ title: `YTPTube: ( ${Object.keys(stateStore.queue).length || 0} | ${Object.keys(stateStore.history).length || 0} )` })
useHead({ title: `YTPTube: ( ${Object.keys(stateStore.queue).length || 0}/${maxWorkers} | ${Object.keys(stateStore.history).length || 0} )` })
})
watch(() => stateStore.history, () => {
if (!config.app.ui_update_title) {
return
}
useHead({ title: `YTPTube: ( ${Object.keys(stateStore.queue).length || 0} | ${Object.keys(stateStore.history).length || 0} )` })
useHead({ title: `YTPTube: ( ${Object.keys(stateStore.queue).length || 0}/${maxWorkers} | ${Object.keys(stateStore.history).length || 0} )` })
}, { deep: true })
watch(() => stateStore.queue, () => {
if (!config.app.ui_update_title) {
return
}
useHead({ title: `YTPTube: ( ${Object.keys(stateStore.queue).length || 0} | ${Object.keys(stateStore.history).length || 0} )` })
useHead({ title: `YTPTube: ( ${Object.keys(stateStore.queue).length || 0}/${maxWorkers} | ${Object.keys(stateStore.history).length || 0} )` })
}, { deep: true })
</script>

View file

@ -7,6 +7,7 @@ const CONFIG_KEYS = {
ui_update_title: true,
output_template: '',
ytdlp_version: '',
max_workers: 1,
version: '',
url_host: '',
url_prefix: '',