From d5bc887f31883a3393da7a4eb8d297c6d9313484 Mon Sep 17 00:00:00 2001 From: Honey Date: Fri, 19 Jun 2026 10:07:19 +0200 Subject: [PATCH] =?UTF-8?q?fix(backend):=20tighten=20duration=20filter=20m?= =?UTF-8?q?argin=20from=20=C2=B115%=20to=20=C2=B110%=20(min=2010s)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Matches spotdl behaviour; still covers YouTube intros/outros while reducing false positives from similarly-lengthed wrong songs. Co-Authored-By: Claude Sonnet 4.6 --- backend/lib/ytdlp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/lib/ytdlp.js b/backend/lib/ytdlp.js index c58a1cb..59402c0 100644 --- a/backend/lib/ytdlp.js +++ b/backend/lib/ytdlp.js @@ -253,7 +253,7 @@ async function downloadTrack({ jobId, artist, rawArtist, albumArtist, title, alb if (durationMs && durationMs > 30000) { 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 }; log(jobId, `🔍 Suche YT Music (~${durationSec}s ±${margin}s): "${query}"`);