diff --git a/src/lib/components/Album.svelte b/src/lib/components/Album.svelte index ea72e0e..9a26d6b 100644 --- a/src/lib/components/Album.svelte +++ b/src/lib/components/Album.svelte @@ -102,6 +102,9 @@ const isNowPlaying = $derived(album?.isNowPlaying ?? false) const nowPlayingTrack = $derived(album?.nowPlayingTrack) + // Use Apple Music URL if available, otherwise fall back to Last.fm + const albumUrl = $derived(album?.appleMusicData?.url || album?.url || '#') + // Debug logging $effect(() => { if (album && (isNowPlaying || album.isNowPlaying)) { @@ -118,7 +121,7 @@ {#if album}
{ diff --git a/src/lib/server/apple-music-client.ts b/src/lib/server/apple-music-client.ts index 1a732c0..54a0791 100644 --- a/src/lib/server/apple-music-client.ts +++ b/src/lib/server/apple-music-client.ts @@ -508,6 +508,7 @@ export async function transformAlbumData(appleMusicAlbum: AppleMusicAlbum) { ? attributes.artwork.url.replace('{w}x{h}', '3000x3000') : undefined, previewUrl, + url: attributes.url, // Store additional metadata for future use genres: attributes.genreNames, releaseDate: attributes.releaseDate, diff --git a/src/lib/types/lastfm.ts b/src/lib/types/lastfm.ts index 335d38f..06a6ded 100644 --- a/src/lib/types/lastfm.ts +++ b/src/lib/types/lastfm.ts @@ -33,6 +33,7 @@ export interface Album { appleMusicId?: string highResArtwork?: string previewUrl?: string + url?: string genres?: string[] releaseDate?: string trackCount?: number