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 <noreply@anthropic.com>
This commit is contained in:
HoneyandClaude Sonnet 4.6 committed 2026-06-19 09:35:32 +02:00
1 parent 319a3804f3
commit ecb7721e3b
1 file changed
+3 -2
+3 -2
View File
@@ -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}`;