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:
1 parent
319a3804f3
commit
ecb7721e3b
1 file changed
+3
-2
@@ -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()))
|
.filter(w => /^[A-Za-z0-9]/.test(w) && !titleWordSet.has(w.toLowerCase()) && !GENERIC_ALBUM_WORDS.has(w.toLowerCase()))
|
||||||
.slice(0, 2).join(' ')
|
.slice(0, 2).join(' ')
|
||||||
: '';
|
: '';
|
||||||
const albumQuerySuffix = (hasJpTitle || (albumWords && titleKws.length <= 1)) && albumWords
|
// Only append album words for Japanese titles where title keywords are stripped to nothing.
|
||||||
? ' ' + albumWords : '';
|
// For Western tracks, artist + title + duration matching is sufficient (matches spotdl behaviour).
|
||||||
|
const albumQuerySuffix = hasJpTitle && albumWords ? ' ' + albumWords : '';
|
||||||
|
|
||||||
const query = `${ytmArtist} - ${title}${albumQuerySuffix}`;
|
const query = `${ytmArtist} - ${title}${albumQuerySuffix}`;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user