webui: send article/result title with RSS manual downloads

So the daemon names the torrent after the feed article or search
result instead of the temp upload filename.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
ookami125 2026-06-23 20:59:06 -04:00
parent b1f33d4194
commit 530390089c

View file

@ -1010,7 +1010,7 @@ async function renderRssView(host, seq) {
})); }));
host.querySelectorAll('.dl-art').forEach((b) => b.addEventListener('click', () => guard(async () => { host.querySelectorAll('.dl-art').forEach((b) => b.addEventListener('click', () => guard(async () => {
const a = articles[+b.dataset.art]; const a = articles[+b.dataset.art];
await api.rssDownload({ magnet: a.magnet || '', torrentUrl: a.torrentUrl || a.link || '', key: a.key || '' }); await api.rssDownload({ title: a.title || '', magnet: a.magnet || '', torrentUrl: a.torrentUrl || a.link || '', key: a.key || '' });
b.textContent = '✓ Added'; b.disabled = true; b.textContent = '✓ Added'; b.disabled = true;
}, 'Failed to add torrent'))); }, 'Failed to add torrent')));
host.querySelectorAll('[data-rule-edit]').forEach((b) => b.addEventListener('click', () => host.querySelectorAll('[data-rule-edit]').forEach((b) => b.addEventListener('click', () =>
@ -1432,7 +1432,7 @@ function bindSearchRows() {
document.querySelectorAll('[data-sr]').forEach((b) => document.querySelectorAll('[data-sr]').forEach((b) =>
b.addEventListener('click', () => guard(async () => { b.addEventListener('click', () => guard(async () => {
const r = state.searchResults[+b.dataset.sr]; const r = state.searchResults[+b.dataset.sr];
await api.rssDownload({ magnet: r.magnet || '', torrentUrl: r.torrentUrl || '' }); await api.rssDownload({ title: r.name || '', magnet: r.magnet || '', torrentUrl: r.torrentUrl || '' });
b.textContent = '✓ Added'; b.disabled = true; b.textContent = '✓ Added'; b.disabled = true;
}, 'Failed to add torrent'))); }, 'Failed to add torrent')));
} }