fix(backend): fix fallback order — try YT with duration filter before dropping filter

Previous order let wrong YTM results through on the no-filter fallback.
New order: YTM+filter → YT+filter → YTM no filter → YT no filter.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
HoneyandClaude Sonnet 4.6 committed 2026-05-02 10:32:10 +02:00
1 parent ce8441d9ee
commit 801a3ae0fd
1 file changed
+6 -6
+6 -6
View File
@@ -228,15 +228,15 @@ async function downloadTrack({ jobId, artist, albumArtist, title, album, year, t
await spawnYtdlp([ytmUrl, '--playlist-items', '1', ...durFilter, ...baseArgs]);
if (!hasAudio()) {
log(jobId, '⚠️ Kein YT-Music-Treffer im Dauerbereich — Suche ohne Filter…');
await spawnYtdlp([ytmUrl, '--playlist-items', '1', ...baseArgs]);
}
if (!hasAudio()) {
log(jobId, '⚠️ Kein YT-Music-Treffer — Fallback zu YouTube…');
log(jobId, '⚠️ Kein YT-Music-Treffer im Dauerbereich — Fallback zu YouTube…');
await spawnYtdlp([`ytsearch1:${query}`, ...durFilter, ...baseArgs]);
}
if (!hasAudio()) {
log(jobId, '⚠️ Kein YouTube-Treffer im Dauerbereich — Suche ohne Filter…');
log(jobId, '⚠️ Kein YouTube-Treffer im Dauerbereich — Suche YT Music ohne Filter…');
await spawnYtdlp([ytmUrl, '--playlist-items', '1', ...baseArgs]);
}
if (!hasAudio()) {
log(jobId, '⚠️ Letzter Versuch: YouTube ohne Filter…');
await spawnYtdlp([`ytsearch1:${query}`, ...baseArgs]);
}
} else {