diff --git a/web/src/lib/api/home.test.ts b/web/src/lib/api/home.test.ts index 6bfac118..354cefd9 100644 --- a/web/src/lib/api/home.test.ts +++ b/web/src/lib/api/home.test.ts @@ -18,7 +18,9 @@ describe('home client', () => { rediscover_albums: [], rediscover_artists: [], most_played_tracks: [], - last_played_artists: [] + last_played_artists: [], + you_might_like_albums: [], + you_might_like_artists: [] }; (api.get as ReturnType).mockResolvedValueOnce(fixture); const got = await listHome(); diff --git a/web/src/lib/api/types.ts b/web/src/lib/api/types.ts index d280e802..c8cdf030 100644 --- a/web/src/lib/api/types.ts +++ b/web/src/lib/api/types.ts @@ -342,4 +342,6 @@ export type HomePayload = { rediscover_artists: ArtistRef[]; most_played_tracks: TrackRef[]; last_played_artists: ArtistRef[]; + you_might_like_albums: AlbumRef[]; + you_might_like_artists: ArtistRef[]; }; diff --git a/web/src/routes/+page.svelte b/web/src/routes/+page.svelte index c692e50b..5f711c2b 100644 --- a/web/src/routes/+page.svelte +++ b/web/src/routes/+page.svelte @@ -161,6 +161,42 @@ {:else if showSkeleton.value && !data}

Loading…

{:else if data} + +
+ {#if data.you_might_like_albums.length === 0 && data.you_might_like_artists.length === 0} +
+

You might like

+
+

We're still learning your taste — keep listening and picks you might like will show up here.

+ {:else} + {#if data.you_might_like_albums.length > 0} + + {#snippet item(album: import('$lib/api/types').AlbumRef)} +
+ {/snippet} +
+ {/if} + {#if data.you_might_like_artists.length > 0} + + {#snippet item(artist: import('$lib/api/types').ArtistRef)} +
+ {/snippet} +
+ {/if} + {/if} +
+
{#if data.recently_added_albums.length === 0} diff --git a/web/src/routes/page.test.ts b/web/src/routes/page.test.ts index 51df7407..b8a6bd17 100644 --- a/web/src/routes/page.test.ts +++ b/web/src/routes/page.test.ts @@ -13,7 +13,9 @@ vi.mock('$lib/api/home', () => ({ most_played_tracks: [], rediscover_albums: [], rediscover_artists: [], - last_played_artists: [] + last_played_artists: [], + you_might_like_albums: [], + you_might_like_artists: [] }, isPending: false, isError: false,