use "album" releasetype as default artist album fallback

This commit is contained in:
jeffvli
2025-12-28 02:03:05 -08:00
parent a3794158f0
commit f43950874d
@@ -895,12 +895,12 @@ const groupAlbumsByReleaseType = (
acc[normalizedType].push(album); acc[normalizedType].push(album);
}); });
} else { } else {
// If no release types, use "other" as fallback // If no release types, use "album" as fallback
const otherKey = 'other'; const albumKey = 'album';
if (!acc[otherKey]) { if (!acc[albumKey]) {
acc[otherKey] = []; acc[albumKey] = [];
} }
acc[otherKey].push(album); acc[albumKey].push(album);
} }
return acc; return acc;
@@ -911,7 +911,7 @@ const groupAlbumsByReleaseType = (
return grouped; return grouped;
} }
// Primary grouping (original behavior) // Group by primary release types
const grouped = albums.reduce( const grouped = albums.reduce(
(acc, album) => { (acc, album) => {
// Priority 1: Appears on - artist is not an album artist // Priority 1: Appears on - artist is not an album artist
@@ -973,23 +973,23 @@ const groupAlbumsByReleaseType = (
return acc; return acc;
} }
// Priority 6: Album // Priority 6: Other
const hasAlbumType = album.releaseTypes?.some((type) => type.toLowerCase() === 'album'); const hasOtherType = album.releaseTypes?.some((type) => type.toLowerCase() === 'other');
if (hasAlbumType) { if (hasOtherType) {
const albumKey = 'album'; const otherKey = 'other';
if (!acc[albumKey]) { if (!acc[otherKey]) {
acc[albumKey] = []; acc[otherKey] = [];
} }
acc[albumKey].push(album); acc[otherKey].push(album);
return acc; return acc;
} }
// Priority 7: Other (catch all for unknown release types or specifically other release types) // Priority 7: Album (falls back all unknown release types to album)
const otherKey = 'other'; const albumKey = 'album';
if (!acc[otherKey]) { if (!acc[albumKey]) {
acc[otherKey] = []; acc[albumKey] = [];
} }
acc[otherKey].push(album); acc[albumKey].push(album);
return acc; return acc;
}, },
{} as Record<string, Album[]>, {} as Record<string, Album[]>,