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:
1 parent
4cbfa35655
commit
d5bc887f31
1 file changed
+1
-1
@@ -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}"`);
|
||||
|
||||
Reference in new issue
Block a user