fix(backend): direct-link download failure was reported as success

The direct-URL (sourceUrl) path returned { success: true } even when no audio
file was produced (e.g. YouTube 403 / bot check), so the job was marked
"done/Fertig!" and web + Android both said the track was added. It now returns
{ failed: true } → the server sets status 'error' with a clear message, which
both frontends already render as a failure. Search-cascade path was already
correct.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
HoneyandClaude Opus 4.8 committed 2026-08-17 12:20:52 +02:00
1 parent 0990dfadb5
commit ef019b9b9d
2 files changed
+6 -1

No files matched your search

+2
View File
@@ -657,6 +657,8 @@ app.post('/api/download', async (req, res) => {
updateJob(jobId, { status: 'done', progress: 100, message: 'Bereits vorhanden – übersprungen', skipped: true });
} else if (result?.notFound) {
updateJob(jobId, { status: 'error', message: 'Nicht eindeutig gefunden — bitte Direktlink im Importer nutzen' });
} else if (result?.failed) {
updateJob(jobId, { status: 'error', message: 'Download fehlgeschlagen — YouTube hat den Abruf blockiert (403).' });
} else {
updateJob(jobId, { status: 'done', progress: 100, message: 'Fertig!' });
}