feat(credits): enable track info for all Qobuz tracks + add artist link
- Add onTrackShowInfo to HomeView (Continue Listening tracks) - Add onShowInfo to VirtualizedTrackList (for FavoritesView) - Add onTrackShowInfo to FavoritesView and wire to VirtualizedTrackList - Pass showTrackInfo to HomeView and FavoritesView in +page.svelte - Add clickable artist name to TrackInfoModal header - Artist link navigates to artist page and closes modal
This commit is contained in:
1 parent
f7161bafe1
commit
1de77ec132
5 files changed
+53
-1
No files matched your search
@@ -7,9 +7,10 @@
|
||||
isOpen: boolean;
|
||||
trackId: number | null;
|
||||
onClose: () => void;
|
||||
onArtistClick?: (artistId: number) => void;
|
||||
}
|
||||
|
||||
let { isOpen, trackId, onClose }: Props = $props();
|
||||
let { isOpen, trackId, onClose, onArtistClick }: Props = $props();
|
||||
|
||||
let loading = $state(false);
|
||||
let error = $state<string | null>(null);
|
||||
@@ -145,6 +146,22 @@
|
||||
{#if trackInfo.track.album?.title}
|
||||
<span class="album-title">{trackInfo.track.album.title}</span>
|
||||
{/if}
|
||||
{#if trackInfo.track.performer?.name}
|
||||
{@const artistId = trackInfo.track.performer.id}
|
||||
{#if artistId && onArtistClick}
|
||||
<button
|
||||
class="artist-link"
|
||||
onclick={() => {
|
||||
onArtistClick(artistId);
|
||||
onClose();
|
||||
}}
|
||||
>
|
||||
{trackInfo.track.performer.name}
|
||||
</button>
|
||||
{:else}
|
||||
<span class="artist-name">{trackInfo.track.performer.name}</span>
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
<button class="close-btn" onclick={onClose} aria-label="Close">
|
||||
<X size={18} />
|
||||
@@ -302,6 +319,29 @@
|
||||
color: var(--text-tertiary, #888888);
|
||||
}
|
||||
|
||||
.artist-link {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: var(--accent-primary);
|
||||
background: none;
|
||||
border: none;
|
||||
padding: 0;
|
||||
cursor: pointer;
|
||||
text-align: left;
|
||||
transition: opacity 200ms ease;
|
||||
}
|
||||
|
||||
.artist-link:hover {
|
||||
opacity: 0.8;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.artist-name {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.close-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
onShareSonglink?: (track: Track) => void;
|
||||
onGoToAlbum?: (albumId: string) => void;
|
||||
onGoToArtist?: (artistId: number) => void;
|
||||
onShowInfo?: (trackId: number) => void;
|
||||
onReDownload?: (track: Track) => void;
|
||||
// For getting artist/album IDs from non-local tracks
|
||||
getArtistId?: (track: Track) => number | undefined;
|
||||
@@ -92,6 +93,7 @@
|
||||
onShareSonglink,
|
||||
onGoToAlbum,
|
||||
onGoToArtist,
|
||||
onShowInfo,
|
||||
onReDownload,
|
||||
getArtistId,
|
||||
getAlbumId,
|
||||
@@ -335,6 +337,7 @@
|
||||
onShareSonglink: onShareSonglink ? () => onShareSonglink(item.track) : undefined,
|
||||
onGoToAlbum: albumId && onGoToAlbum ? () => onGoToAlbum(albumId) : undefined,
|
||||
onGoToArtist: artistId && onGoToArtist ? () => onGoToArtist(artistId) : undefined,
|
||||
onShowInfo: !isLocal && onShowInfo ? () => onShowInfo(trackId) : undefined,
|
||||
onDownload: onDownload ? () => onDownload(item.track) : undefined,
|
||||
isTrackDownloaded,
|
||||
onReDownload: isTrackDownloaded && onReDownload ? () => onReDownload(item.track) : undefined,
|
||||
|
||||
@@ -74,6 +74,7 @@
|
||||
onTrackShareSonglink?: (track: DisplayTrack) => void;
|
||||
onTrackGoToAlbum?: (albumId: string) => void;
|
||||
onTrackGoToArtist?: (artistId: number) => void;
|
||||
onTrackShowInfo?: (trackId: number) => void;
|
||||
onTrackDownload?: (track: DisplayTrack) => void;
|
||||
onTrackRemoveDownload?: (trackId: number) => void;
|
||||
onTrackReDownload?: (track: DisplayTrack) => void;
|
||||
@@ -124,6 +125,7 @@
|
||||
onTrackShareSonglink,
|
||||
onTrackGoToAlbum,
|
||||
onTrackGoToArtist,
|
||||
onTrackShowInfo,
|
||||
onTrackDownload,
|
||||
onTrackRemoveDownload,
|
||||
onTrackReDownload,
|
||||
@@ -1239,6 +1241,7 @@
|
||||
onShareSonglink={onTrackShareSonglink ? (t) => onTrackShareSonglink(buildDisplayTrackFromFavorite(t)) : undefined}
|
||||
onGoToAlbum={onTrackGoToAlbum}
|
||||
onGoToArtist={onTrackGoToArtist}
|
||||
onShowInfo={onTrackShowInfo}
|
||||
onReDownload={onTrackReDownload ? (t) => onTrackReDownload(buildDisplayTrackFromFavorite(t)) : undefined}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -69,6 +69,7 @@
|
||||
onTrackShareSonglink?: (track: DisplayTrack) => void;
|
||||
onTrackGoToAlbum?: (albumId: string) => void;
|
||||
onTrackGoToArtist?: (artistId: number) => void;
|
||||
onTrackShowInfo?: (trackId: number) => void;
|
||||
onTrackDownload?: (track: DisplayTrack) => void;
|
||||
onTrackRemoveDownload?: (trackId: number) => void;
|
||||
onTrackReDownload?: (track: DisplayTrack) => void;
|
||||
@@ -101,6 +102,7 @@
|
||||
onTrackShareSonglink,
|
||||
onTrackGoToAlbum,
|
||||
onTrackGoToArtist,
|
||||
onTrackShowInfo,
|
||||
onTrackDownload,
|
||||
onTrackRemoveDownload,
|
||||
onTrackReDownload,
|
||||
@@ -838,6 +840,7 @@
|
||||
onShareSonglink: onTrackShareSonglink ? () => onTrackShareSonglink(track) : undefined,
|
||||
onGoToAlbum: track.albumId && onTrackGoToAlbum ? () => onTrackGoToAlbum(track.albumId!) : undefined,
|
||||
onGoToArtist: track.artistId && onTrackGoToArtist ? () => onTrackGoToArtist(track.artistId!) : undefined,
|
||||
onShowInfo: onTrackShowInfo ? () => onTrackShowInfo(track.id) : undefined,
|
||||
onDownload: onTrackDownload ? () => onTrackDownload(track) : undefined,
|
||||
isTrackDownloaded,
|
||||
onReDownload: isTrackDownloaded && onTrackReDownload ? () => onTrackReDownload(track) : undefined,
|
||||
|
||||
Reference in new issue
Block a user