From ecb7721e3b09e0566b7b54d2a1b0f70d21f62bf4 Mon Sep 17 00:00:00 2001 From: Honey Date: Fri, 19 Jun 2026 09:35:32 +0200 Subject: [PATCH] fix(backend): only append album to YTM query for Japanese titles Western tracks now use artist + title only (matches spotdl behaviour). Album suffix was causing noise for short English titles like singles where album name = title + "Single". Co-Authored-By: Claude Sonnet 4.6 --- backend/lib/ytdlp.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/lib/ytdlp.js b/backend/lib/ytdlp.js index e4ed5be..937b517 100644 --- a/backend/lib/ytdlp.js +++ b/backend/lib/ytdlp.js @@ -135,8 +135,9 @@ async function downloadTrack({ jobId, artist, rawArtist, albumArtist, title, alb .filter(w => /^[A-Za-z0-9]/.test(w) && !titleWordSet.has(w.toLowerCase()) && !GENERIC_ALBUM_WORDS.has(w.toLowerCase())) .slice(0, 2).join(' ') : ''; - const albumQuerySuffix = (hasJpTitle || (albumWords && titleKws.length <= 1)) && albumWords - ? ' ' + albumWords : ''; + // Only append album words for Japanese titles where title keywords are stripped to nothing. + // For Western tracks, artist + title + duration matching is sufficient (matches spotdl behaviour). + const albumQuerySuffix = hasJpTitle && albumWords ? ' ' + albumWords : ''; const query = `${ytmArtist} - ${title}${albumQuerySuffix}`;