fix(artist): improve album categorization logic
- Live albums: detect broadcasts, tour dates, concert recordings - Others: include FM broadcasts, bootlegs, compilations, tributes - Others: detect soundtracks, various artists releases - Filters: cover albums, demos, rehearsals, radio sessions - Pattern matching: more comprehensive regex for edge cases Fixes issue with Metallica FM Broadcasts and live albums not being properly categorized. cp
This commit is contained in:
1 parent
8a010800dc
commit
f2c236b861
1 file changed
+13
-2
@@ -86,13 +86,24 @@ function isLiveAlbum(album: QobuzAlbum): boolean {
|
||||
|
||||
if (genre.includes('live')) return true;
|
||||
|
||||
return /\blive\b|\blive at\b|\blive in\b|\ben concert\b|\bin concert\b|\bconcert\b|\bunplugged\b|\bsessions?\b/.test(title);
|
||||
// More comprehensive live album patterns
|
||||
return /\blive\b|\blive at\b|\blive in\b|\ben concert\b|\bin concert\b|\bconcert\b|\bunplugged\b|\bsessions?\b|\btour\b|\b(19|20)\d{2}\b.*\blive|\bconcerts?\b|\broadcast\b|\bfm broadcast\b/.test(title);
|
||||
}
|
||||
|
||||
function isOtherAlbum(album: QobuzAlbum): boolean {
|
||||
const title = album.title?.toLowerCase() ?? '';
|
||||
const label = album.label?.name?.toLowerCase() ?? '';
|
||||
|
||||
return /\b(greatest hits|best of|anthology|collection|box set|essentials|retrospective|very best)\b/.test(title);
|
||||
// Greatest hits, compilations, bootlegs, broadcasts, tributes
|
||||
const isCompilation = /\b(greatest hits|best of|anthology|collection|box set|essentials|retrospective|very best|compilation|tribute|cover)\b/.test(title);
|
||||
|
||||
// Broadcasts, bootlegs, unofficial releases
|
||||
const isBroadcastOrBootleg = /\b(broadcast|fm broadcast|radio|bootleg|unofficial|interview|rarities|outtakes|demos|sessions|rehearsal|soundcheck)\b/.test(title);
|
||||
|
||||
// Soundtrack, various artists
|
||||
const isVariousOrSoundtrack = /\b(soundtrack|ost|various artists|va)\b/.test(title) || /\b(various|va)\b/.test(label);
|
||||
|
||||
return isCompilation || isBroadcastOrBootleg || isVariousOrSoundtrack;
|
||||
}
|
||||
|
||||
function toArtistAlbumSummary(album: QobuzAlbum): ArtistAlbumSummary {
|
||||
|
||||
Reference in new issue
Block a user