From b08be6f8f022883273259d612f9a685042524851 Mon Sep 17 00:00:00 2001 From: arabcoders Date: Fri, 4 Apr 2025 23:05:26 +0300 Subject: [PATCH] retain extras data when re-queueing via alt+click --- ui/components/History.vue | 2 +- ui/components/NewDownload.vue | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ui/components/History.vue b/ui/components/History.vue index 3e424c24..c65e70e2 100644 --- a/ui/components/History.vue +++ b/ui/components/History.vue @@ -627,7 +627,7 @@ const removeItem = item => { const reQueueItem = (item, event = null) => { let extras = {} - if (item.extras) { + if (item?.extras) { Object.keys(item.extras).forEach(k => { if (k && true === k.startsWith('playlist')) { extras[k] = item.extras[k] diff --git a/ui/components/NewDownload.vue b/ui/components/NewDownload.vue index dc013a87..4719e276 100644 --- a/ui/components/NewDownload.vue +++ b/ui/components/NewDownload.vue @@ -195,6 +195,7 @@ const form = useStorage('local_config', { cli: '', template: '', folder: '', + extras: {}, }) const addDownload = async () => { @@ -211,14 +212,20 @@ const addDownload = async () => { if (!url.trim()) { return } - socket.emit('add_url', { + const data = { url: url, preset: config.app.basic_mode ? config.app.default_preset : form.value.preset, folder: config.app.basic_mode ? null : form.value.folder, template: config.app.basic_mode ? null : form.value.template, cookies: config.app.basic_mode ? '' : form.value.cookies, cli: config.app.basic_mode ? null : form.value.cli, - }) + } + + if (form.value?.extras && Object.keys(form.value.extras).length > 0) { + data.extras = form.value.extras + } + + socket.emit('add_url', data) }) }