From 4fd35ec1f0fe2eedcc0857630e7309d11be9b39e Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Fri, 11 Jul 2025 20:12:13 -0700 Subject: [PATCH] feat: link albums to Apple Music when available MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add URL field to Apple Music data type - Include Apple Music URL in album transformation - Prioritize Apple Music links over Last.fm in Album component - Falls back to Last.fm URL when Apple Music data unavailable 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- src/lib/components/Album.svelte | 5 ++++- src/lib/server/apple-music-client.ts | 1 + src/lib/types/lastfm.ts | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) 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}