fix: separate appears_on releases from regular releases in artist page
This commit is contained in:
@@ -246,9 +246,10 @@ export const Artist = () => {
|
||||
return <div>Artist data could not be fully loaded. Please try again later.</div>;
|
||||
}
|
||||
|
||||
const artistAlbums = applyFilters(albums.filter((album) => album.album_type === "album"));
|
||||
const artistSingles = applyFilters(albums.filter((album) => album.album_type === "single"));
|
||||
const artistCompilations = applyFilters(albums.filter((album) => album.album_type === "compilation"));
|
||||
const artistAlbums = applyFilters(albums.filter((album) => (album.album_group ?? album.album_type) === "album"));
|
||||
const artistSingles = applyFilters(albums.filter((album) => (album.album_group ?? album.album_type) === "single"));
|
||||
const artistCompilations = applyFilters(albums.filter((album) => (album.album_group ?? album.album_type) === "compilation"));
|
||||
const artistAppearsOn = applyFilters(albums.filter((album) => (album.album_group ?? "") === "appears_on"));
|
||||
|
||||
return (
|
||||
<div className="artist-page">
|
||||
@@ -364,6 +365,18 @@ export const Artist = () => {
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Appears On */}
|
||||
{artistAppearsOn.length > 0 && (
|
||||
<div className="mb-12">
|
||||
<h2 className="text-3xl font-bold mb-6 text-content-primary dark:text-content-primary-dark">Appears On</h2>
|
||||
<div className="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-6">
|
||||
{artistAppearsOn.map((album) => (
|
||||
<AlbumCard key={album.id} album={album} onDownload={() => handleDownloadAlbum(album)} />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* sentinel + loading */}
|
||||
<div className="flex flex-col items-center gap-2">
|
||||
{loadingMore && <div className="py-4">Loading more...</div>}
|
||||
|
||||
@@ -44,6 +44,7 @@ export interface AlbumType {
|
||||
id: string;
|
||||
name: string;
|
||||
album_type: "album" | "single" | "compilation";
|
||||
album_group?: "album" | "single" | "compilation" | "appears_on";
|
||||
artists: ArtistType[];
|
||||
images: ImageType[];
|
||||
release_date: string;
|
||||
|
||||
Reference in New Issue
Block a user