fix(backend): tighten duration filter margin from ±15% to ±10% (min 10s)

Matches spotdl behaviour; still covers YouTube intros/outros while
reducing false positives from similarly-lengthed wrong songs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
HoneyandClaude Sonnet 4.6 committed 2026-06-19 10:07:19 +02:00
1 parent 4cbfa35655
commit d5bc887f31
1 file changed
+1 -1
+1 -1
View File
@@ -253,7 +253,7 @@ async function downloadTrack({ jobId, artist, rawArtist, albumArtist, title, alb
if (durationMs && durationMs > 30000) { if (durationMs && durationMs > 30000) {
const durationSec = Math.round(durationMs / 1000); const durationSec = Math.round(durationMs / 1000);
const margin = Math.max(15, Math.round(durationSec * 0.15)); const margin = Math.max(10, Math.round(durationSec * 0.10));
const dur = { min: Math.max(30, durationSec - margin), max: durationSec + margin }; const dur = { min: Math.max(30, durationSec - margin), max: durationSec + margin };
log(jobId, `🔍 Suche YT Music (~${durationSec}s ±${margin}s): "${query}"`); log(jobId, `🔍 Suche YT Music (~${durationSec}s ±${margin}s): "${query}"`);