feat(ui): wire artist click through all views using AlbumCard
Pass artistId and onArtistClick to AlbumCard in HomeView, SearchView, FavoritesView, LabelView, and AlbumDetailView. Add artistId to AlbumCardData interface. Add onArtistClick prop to LabelView and wire it from +page.svelte.
This commit is contained in:
1 parent
f5d947e8f1
commit
f3be2b737f
8 files changed
+42
-2
No files matched your search
@@ -81,7 +81,7 @@
|
||||
let titleRef: HTMLDivElement | null = $state(null);
|
||||
let titleTextRef: HTMLSpanElement | null = $state(null);
|
||||
let titleOverflow = $state(0);
|
||||
let artistRef: HTMLDivElement | null = $state(null);
|
||||
let artistRef: HTMLElement | null = $state(null);
|
||||
let artistTextRef: HTMLSpanElement | null = $state(null);
|
||||
let artistOverflow = $state(0);
|
||||
const titleOffset = $derived(titleOverflow > 0 ? `-${titleOverflow + 16}px` : '0px');
|
||||
|
||||
@@ -515,6 +515,8 @@
|
||||
artwork={relatedAlbum.artwork}
|
||||
title={relatedAlbum.title}
|
||||
artist={album.artist}
|
||||
artistId={album.artistId}
|
||||
onArtistClick={onTrackGoToArtist}
|
||||
genre={relatedAlbum.genre}
|
||||
releaseDate={relatedAlbum.releaseDate}
|
||||
size="large"
|
||||
|
||||
@@ -1639,6 +1639,8 @@
|
||||
artwork={album.image?.large || album.image?.thumbnail || ''}
|
||||
title={album.title}
|
||||
artist={album.artist.name}
|
||||
artistId={album.artist.id}
|
||||
onArtistClick={onArtistClick}
|
||||
genre={getGenreLabel(album)}
|
||||
releaseDate={album.release_date_original}
|
||||
size="large"
|
||||
@@ -1715,6 +1717,8 @@
|
||||
artwork={album.image?.large || album.image?.thumbnail || ''}
|
||||
title={album.title}
|
||||
artist={album.artist.name}
|
||||
artistId={album.artist.id}
|
||||
onArtistClick={onArtistClick}
|
||||
genre={getGenreLabel(album)}
|
||||
releaseDate={album.release_date_original}
|
||||
size="large"
|
||||
@@ -1889,6 +1893,8 @@
|
||||
artwork={getQobuzImage(album.image)}
|
||||
title={album.title}
|
||||
artist={album.artist.name}
|
||||
artistId={album.artist.id}
|
||||
onArtistClick={onArtistClick}
|
||||
genre={album.genre?.name}
|
||||
releaseDate={album.release_date_original}
|
||||
quality={formatQuality(album.hires_streamable, album.maximum_bit_depth, album.maximum_sampling_rate)}
|
||||
@@ -1941,6 +1947,8 @@
|
||||
artwork={getQobuzImage(album.image)}
|
||||
title={album.title}
|
||||
artist={album.artist.name}
|
||||
artistId={album.artist.id}
|
||||
onArtistClick={onArtistClick}
|
||||
genre={album.genre?.name}
|
||||
releaseDate={album.release_date_original}
|
||||
quality={formatQuality(album.hires_streamable, album.maximum_bit_depth, album.maximum_sampling_rate)}
|
||||
@@ -1993,6 +2001,8 @@
|
||||
artwork={getQobuzImage(album.image)}
|
||||
title={album.title}
|
||||
artist={album.artist.name}
|
||||
artistId={album.artist.id}
|
||||
onArtistClick={onArtistClick}
|
||||
genre={album.genre?.name}
|
||||
releaseDate={album.release_date_original}
|
||||
quality={formatQuality(album.hires_streamable, album.maximum_bit_depth, album.maximum_sampling_rate)}
|
||||
|
||||
@@ -71,6 +71,7 @@
|
||||
artwork: string;
|
||||
title: string;
|
||||
artist: string;
|
||||
artistId?: number;
|
||||
genre: string;
|
||||
quality?: string;
|
||||
releaseDate?: string;
|
||||
@@ -554,6 +555,7 @@
|
||||
artwork: getQobuzImage(album.image),
|
||||
title: album.title,
|
||||
artist: album.artist?.name || 'Unknown Artist',
|
||||
artistId: album.artist?.id,
|
||||
genre: album.genre?.name || 'Unknown genre',
|
||||
quality: formatQuality(album.hires_streamable, album.maximum_bit_depth, album.maximum_sampling_rate),
|
||||
releaseDate: album.release_date_original
|
||||
@@ -946,6 +948,8 @@
|
||||
artwork={album.artwork}
|
||||
title={album.title}
|
||||
artist={album.artist}
|
||||
artistId={album.artistId}
|
||||
onArtistClick={onArtistClick}
|
||||
genre={album.genre}
|
||||
releaseDate={album.releaseDate}
|
||||
size="large"
|
||||
@@ -987,6 +991,8 @@
|
||||
artwork={album.artwork}
|
||||
title={album.title}
|
||||
artist={album.artist}
|
||||
artistId={album.artistId}
|
||||
onArtistClick={onArtistClick}
|
||||
genre={album.genre}
|
||||
releaseDate={album.releaseDate}
|
||||
size="large"
|
||||
@@ -1028,6 +1034,8 @@
|
||||
artwork={album.artwork}
|
||||
title={album.title}
|
||||
artist={album.artist}
|
||||
artistId={album.artistId}
|
||||
onArtistClick={onArtistClick}
|
||||
genre={album.genre}
|
||||
releaseDate={album.releaseDate}
|
||||
size="large"
|
||||
@@ -1069,6 +1077,8 @@
|
||||
artwork={album.artwork}
|
||||
title={album.title}
|
||||
artist={album.artist}
|
||||
artistId={album.artistId}
|
||||
onArtistClick={onArtistClick}
|
||||
genre={album.genre}
|
||||
releaseDate={album.releaseDate}
|
||||
size="large"
|
||||
@@ -1110,6 +1120,8 @@
|
||||
artwork={album.artwork}
|
||||
title={album.title}
|
||||
artist={album.artist}
|
||||
artistId={album.artistId}
|
||||
onArtistClick={onArtistClick}
|
||||
genre={album.genre}
|
||||
releaseDate={album.releaseDate}
|
||||
size="large"
|
||||
@@ -1201,6 +1213,8 @@
|
||||
artwork={album.image?.large || album.image?.small || ''}
|
||||
title={album.title}
|
||||
artist={album.artists?.[0]?.name || 'Unknown Artist'}
|
||||
artistId={album.artists?.[0]?.id}
|
||||
onArtistClick={onArtistClick}
|
||||
genre={album.genre?.name || ''}
|
||||
releaseDate={album.dates?.original}
|
||||
size="large"
|
||||
@@ -1246,6 +1260,8 @@
|
||||
artwork={album.artwork}
|
||||
title={album.title}
|
||||
artist={album.artist}
|
||||
artistId={album.artistId}
|
||||
onArtistClick={onArtistClick}
|
||||
genre={album.genre}
|
||||
releaseDate={album.releaseDate}
|
||||
size="large"
|
||||
@@ -1392,6 +1408,8 @@
|
||||
artwork={album.artwork}
|
||||
title={album.title}
|
||||
artist={album.artist}
|
||||
artistId={album.artistId}
|
||||
onArtistClick={onArtistClick}
|
||||
genre={album.genre}
|
||||
releaseDate={album.releaseDate}
|
||||
size="large"
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
onReDownloadAlbum?: (albumId: string) => void;
|
||||
checkAlbumFullyDownloaded?: (albumId: string) => Promise<boolean>;
|
||||
downloadStateVersion?: number;
|
||||
onArtistClick?: (artistId: number) => void;
|
||||
}
|
||||
|
||||
let {
|
||||
@@ -39,7 +40,8 @@
|
||||
onOpenAlbumFolder,
|
||||
onReDownloadAlbum,
|
||||
checkAlbumFullyDownloaded,
|
||||
downloadStateVersion
|
||||
downloadStateVersion,
|
||||
onArtistClick
|
||||
}: Props = $props();
|
||||
|
||||
// State
|
||||
@@ -277,6 +279,8 @@
|
||||
artwork={album.image?.large || album.image?.thumbnail || ''}
|
||||
title={album.title}
|
||||
artist={album.artist?.name || 'Unknown Artist'}
|
||||
artistId={album.artist?.id}
|
||||
onArtistClick={onArtistClick}
|
||||
genre={getGenreLabel(album)}
|
||||
releaseDate={album.release_date_original}
|
||||
quality={getQualityLabel(album)}
|
||||
|
||||
@@ -1287,6 +1287,8 @@
|
||||
artwork={getAlbumArtwork(album)}
|
||||
title={album.title}
|
||||
artist={album.artist?.name || 'Unknown Artist'}
|
||||
artistId={album.artist?.id}
|
||||
onArtistClick={onArtistClick}
|
||||
genre={getGenreLabel(album)}
|
||||
releaseDate={album.release_date_original}
|
||||
size="large"
|
||||
@@ -1459,6 +1461,8 @@
|
||||
artwork={getAlbumArtwork(album)}
|
||||
title={album.title}
|
||||
artist={album.artist?.name || 'Unknown Artist'}
|
||||
artistId={album.artist?.id}
|
||||
onArtistClick={onArtistClick}
|
||||
genre={getGenreLabel(album)}
|
||||
releaseDate={album.release_date_original}
|
||||
size="large"
|
||||
|
||||
@@ -13,6 +13,7 @@ export interface AlbumCardData {
|
||||
artwork: string;
|
||||
title: string;
|
||||
artist: string;
|
||||
artistId?: number;
|
||||
genre: string;
|
||||
quality?: string;
|
||||
releaseDate?: string;
|
||||
|
||||
Reference in new issue
Block a user