retain extras data when re-queueing via alt+click

This commit is contained in:
arabcoders 2025-04-04 23:05:26 +03:00
parent 260901cfa9
commit b08be6f8f0
2 changed files with 10 additions and 3 deletions

View file

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

View file

@ -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)
})
}