diff --git a/backend/services/discover/homepage_service.py b/backend/services/discover/homepage_service.py index 0360b99..0909533 100644 --- a/backend/services/discover/homepage_service.py +++ b/backend/services/discover/homepage_service.py @@ -972,7 +972,7 @@ class DiscoverHomepageService: ) items.append(HomeAlbum( mbid=mbid, - name=r.get("title", r.get("release_group_name", "Unknown")), + name=r.get("release_name", r.get("title", "Unknown")), artist_name=r.get("artist_credit_name", r.get("artist_name", "")), artist_mbid=artist_mbids[0] if artist_mbids else None, listen_count=r.get("listen_count"), diff --git a/backend/services/discover/queue_service.py b/backend/services/discover/queue_service.py index 96555ae..087c575 100644 --- a/backend/services/discover/queue_service.py +++ b/backend/services/discover/queue_service.py @@ -271,7 +271,7 @@ class DiscoverQueueService: if isinstance(artist_mbids, list) and artist_mbids: first_artist_mbid = self._mbid.normalize_mbid(artist_mbids[0]) or "" - album_name = release.get("title") or release.get("release_group_name") or "Unknown" + album_name = release.get("release_name") or release.get("title") or "Unknown" artist_name = release.get("artist_credit_name") or release.get("artist_name") or "Unknown" items.append( self._mbid.make_queue_item( diff --git a/backend/tests/services/test_discover_service.py b/backend/tests/services/test_discover_service.py index b3598e1..ecff24f 100644 --- a/backend/tests/services/test_discover_service.py +++ b/backend/tests/services/test_discover_service.py @@ -364,7 +364,7 @@ class TestDiscoverQueuePersonalization: return_value=[ { "release_group_mbid": "fresh-rg-1", - "title": "Fresh Album", + "release_name": "Fresh Album", "artist_credit_name": "Fresh Artist", "artist_mbids": ["fresh-artist-1"], } diff --git a/frontend/src/lib/components/HomeSection.svelte b/frontend/src/lib/components/HomeSection.svelte index 23db785..a893315 100644 --- a/frontend/src/lib/components/HomeSection.svelte +++ b/frontend/src/lib/components/HomeSection.svelte @@ -37,6 +37,7 @@ headerLink?: string | null; headerActions?: Snippet; hideHeader?: boolean; + showPreview?: boolean; } let { @@ -44,7 +45,8 @@ showConnectCard = true, headerLink = null, headerActions, - hideHeader = false + hideHeader = false, + showPreview = true }: Props = $props(); function getGenreHref(genre: HomeGenre): string { @@ -256,7 +258,7 @@ {/if} - {#if item.mbid} + {#if item.mbid && (($integrationStore.lidarr && !item.in_library && !isItemRequested) || showPreview)}
{#if $integrationStore.lidarr && !item.in_library && !isItemRequested} {/if} - + {#if showPreview} + + {/if}
{/if} diff --git a/frontend/src/lib/components/WeeklyExplorationCard.svelte b/frontend/src/lib/components/WeeklyExplorationCard.svelte index 25ce1a0..d4ae5ce 100644 --- a/frontend/src/lib/components/WeeklyExplorationCard.svelte +++ b/frontend/src/lib/components/WeeklyExplorationCard.svelte @@ -2,7 +2,9 @@ import type { WeeklyExplorationTrack, YouTubeQuotaStatus } from '$lib/types'; import { Music2, Disc3 } from 'lucide-svelte'; import { albumHrefOrNull, artistHrefOrNull } from '$lib/utils/entityRoutes'; - import YouTubeIcon from './YouTubeIcon.svelte'; + import { integrationStore } from '$lib/stores/integration'; + import { libraryStore } from '$lib/stores/library'; + import AlbumRequestButton from './AlbumRequestButton.svelte'; import TrackPreviewButton from './TrackPreviewButton.svelte'; interface Props { @@ -25,6 +27,8 @@ const albumHref = $derived(albumHrefOrNull(track.release_group_mbid)); const artistHref = $derived(artistHrefOrNull(track.artist_mbid)); + const albumMbid = $derived(track.release_group_mbid); + const isRequested = $derived(albumMbid ? libraryStore.isRequested(albumMbid) : false); function formatDuration(ms: number | null): string { if (!ms) return ''; @@ -34,11 +38,6 @@ return `${min}:${sec.toString().padStart(2, '0')}`; } - function youtubeSearchUrl(): string { - const q = [track.artist_name, track.title].filter(Boolean).join(' '); - return `https://www.youtube.com/results?search_query=${encodeURIComponent(q)}`; - } - let imgError = $state(false); @@ -139,6 +138,14 @@
+ {#if albumMbid && $integrationStore.lidarr && !isRequested} + + {/if} -
- - - -
{#if showQuota && quotaInfo} diff --git a/frontend/src/routes/+page.svelte b/frontend/src/routes/+page.svelte index 6b79d2b..f414790 100644 --- a/frontend/src/routes/+page.svelte +++ b/frontend/src/routes/+page.svelte @@ -39,7 +39,13 @@ } type PreGenreBlock = - | { key: string; kind: 'section'; section: HomeSectionType; link?: string } + | { + key: string; + kind: 'section'; + section: HomeSectionType; + link?: string; + showPreview?: boolean; + } | { key: 'weekly_exploration'; kind: 'weekly'; section: WeeklyExplorationSectionType }; function getPreGenreBlocks(): PreGenreBlock[] { @@ -77,7 +83,8 @@ key: 'your_top_albums', kind: 'section', section: homeData.your_top_albums, - link: '/your-top' + link: '/your-top', + showPreview: false }); } if (homeData.recently_played && homeData.recently_played.items.length > 0) { @@ -92,7 +99,8 @@ key: 'recently_added', kind: 'section', section: homeData.recently_added, - link: '/library/albums' + link: '/library/albums', + showPreview: false }); } return blocks; @@ -235,7 +243,11 @@ {#each whatsHotBlocks as block (block.key)}
{#if block.kind === 'section'} - + {:else} {#if block.kind === 'section'} - + {:else}