feat: add Qobuzissimes and Editor's Picks sections
- Add qobuzissimes and editorPicks sections (disabled by default) - Conditional loading to save API calls when sections are hidden - Note: These API types may not be confirmed working
This commit is contained in:
1 parent
23e6df6efe
commit
8cbb65aaee
2 files changed
+64
No files matched your search
@@ -87,6 +87,8 @@
|
|||||||
let loadingNewReleases = $state(true);
|
let loadingNewReleases = $state(true);
|
||||||
let loadingPressAwards = $state(true);
|
let loadingPressAwards = $state(true);
|
||||||
let loadingMostStreamed = $state(true);
|
let loadingMostStreamed = $state(true);
|
||||||
|
let loadingQobuzissimes = $state(true);
|
||||||
|
let loadingEditorPicks = $state(true);
|
||||||
let loadingRecentAlbums = $state(true);
|
let loadingRecentAlbums = $state(true);
|
||||||
let loadingContinueTracks = $state(true);
|
let loadingContinueTracks = $state(true);
|
||||||
let loadingTopArtists = $state(true);
|
let loadingTopArtists = $state(true);
|
||||||
@@ -96,6 +98,8 @@
|
|||||||
let newReleases = $state<AlbumCardData[]>([]);
|
let newReleases = $state<AlbumCardData[]>([]);
|
||||||
let pressAwards = $state<AlbumCardData[]>([]);
|
let pressAwards = $state<AlbumCardData[]>([]);
|
||||||
let mostStreamed = $state<AlbumCardData[]>([]);
|
let mostStreamed = $state<AlbumCardData[]>([]);
|
||||||
|
let qobuzissimes = $state<AlbumCardData[]>([]);
|
||||||
|
let editorPicks = $state<AlbumCardData[]>([]);
|
||||||
|
|
||||||
// User-specific content
|
// User-specific content
|
||||||
let recentAlbums = $state<AlbumCardData[]>([]);
|
let recentAlbums = $state<AlbumCardData[]>([]);
|
||||||
@@ -109,6 +113,8 @@
|
|||||||
newReleases.length > 0
|
newReleases.length > 0
|
||||||
|| pressAwards.length > 0
|
|| pressAwards.length > 0
|
||||||
|| mostStreamed.length > 0
|
|| mostStreamed.length > 0
|
||||||
|
|| qobuzissimes.length > 0
|
||||||
|
|| editorPicks.length > 0
|
||||||
|| recentAlbums.length > 0
|
|| recentAlbums.length > 0
|
||||||
|| continueTracks.length > 0
|
|| continueTracks.length > 0
|
||||||
|| topArtists.length > 0
|
|| topArtists.length > 0
|
||||||
@@ -254,6 +260,8 @@
|
|||||||
loadingNewReleases = true;
|
loadingNewReleases = true;
|
||||||
loadingPressAwards = true;
|
loadingPressAwards = true;
|
||||||
loadingMostStreamed = true;
|
loadingMostStreamed = true;
|
||||||
|
loadingQobuzissimes = true;
|
||||||
|
loadingEditorPicks = true;
|
||||||
loadingRecentAlbums = true;
|
loadingRecentAlbums = true;
|
||||||
loadingContinueTracks = true;
|
loadingContinueTracks = true;
|
||||||
loadingTopArtists = true;
|
loadingTopArtists = true;
|
||||||
@@ -291,6 +299,24 @@
|
|||||||
loadingMostStreamed = false;
|
loadingMostStreamed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isSectionVisible('qobuzissimes')) {
|
||||||
|
fetchFeaturedAlbums('qobuzissimes', LIMITS.featuredAlbums).then(albums => {
|
||||||
|
qobuzissimes = albums;
|
||||||
|
loadingQobuzissimes = false;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
loadingQobuzissimes = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isSectionVisible('editorPicks')) {
|
||||||
|
fetchFeaturedAlbums('editor-picks', LIMITS.featuredAlbums).then(albums => {
|
||||||
|
editorPicks = albums;
|
||||||
|
loadingEditorPicks = false;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
loadingEditorPicks = false;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// ML-based scoring for personalized recommendations (falls back to simple queries if no scores)
|
// ML-based scoring for personalized recommendations (falls back to simple queries if no scores)
|
||||||
const seeds = await invoke<HomeSeeds>('reco_get_home_ml', {
|
const seeds = await invoke<HomeSeeds>('reco_get_home_ml', {
|
||||||
@@ -440,6 +466,40 @@
|
|||||||
</HorizontalScrollRow>
|
</HorizontalScrollRow>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
{#if sectionId === 'qobuzissimes' && qobuzissimes.length > 0}
|
||||||
|
<HorizontalScrollRow title="Qobuzissimes">
|
||||||
|
{#snippet children()}
|
||||||
|
{#each qobuzissimes as album}
|
||||||
|
<AlbumCard
|
||||||
|
artwork={album.artwork}
|
||||||
|
title={album.title}
|
||||||
|
artist={album.artist}
|
||||||
|
quality={album.quality}
|
||||||
|
onclick={() => onAlbumClick?.(album.id)}
|
||||||
|
/>
|
||||||
|
{/each}
|
||||||
|
<div class="spacer"></div>
|
||||||
|
{/snippet}
|
||||||
|
</HorizontalScrollRow>
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
{#if sectionId === 'editorPicks' && editorPicks.length > 0}
|
||||||
|
<HorizontalScrollRow title="Editor's Picks">
|
||||||
|
{#snippet children()}
|
||||||
|
{#each editorPicks as album}
|
||||||
|
<AlbumCard
|
||||||
|
artwork={album.artwork}
|
||||||
|
title={album.title}
|
||||||
|
artist={album.artist}
|
||||||
|
quality={album.quality}
|
||||||
|
onclick={() => onAlbumClick?.(album.id)}
|
||||||
|
/>
|
||||||
|
{/each}
|
||||||
|
<div class="spacer"></div>
|
||||||
|
{/snippet}
|
||||||
|
</HorizontalScrollRow>
|
||||||
|
{/if}
|
||||||
|
|
||||||
{#if sectionId === 'recentAlbums' && recentAlbums.length > 0}
|
{#if sectionId === 'recentAlbums' && recentAlbums.length > 0}
|
||||||
<HorizontalScrollRow title="Recently Played">
|
<HorizontalScrollRow title="Recently Played">
|
||||||
{#snippet children()}
|
{#snippet children()}
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ export type HomeSectionId =
|
|||||||
| 'newReleases'
|
| 'newReleases'
|
||||||
| 'pressAwards'
|
| 'pressAwards'
|
||||||
| 'mostStreamed'
|
| 'mostStreamed'
|
||||||
|
| 'qobuzissimes'
|
||||||
|
| 'editorPicks'
|
||||||
| 'recentAlbums'
|
| 'recentAlbums'
|
||||||
| 'continueTracks'
|
| 'continueTracks'
|
||||||
| 'topArtists'
|
| 'topArtists'
|
||||||
@@ -37,6 +39,8 @@ const DEFAULT_SECTIONS: HomeSection[] = [
|
|||||||
{ id: 'newReleases', label: 'New Releases', visible: true, source: 'qobuz' },
|
{ id: 'newReleases', label: 'New Releases', visible: true, source: 'qobuz' },
|
||||||
{ id: 'pressAwards', label: 'Press Awards', visible: true, source: 'qobuz' },
|
{ id: 'pressAwards', label: 'Press Awards', visible: true, source: 'qobuz' },
|
||||||
{ id: 'mostStreamed', label: 'Popular Albums', visible: false, source: 'qobuz' },
|
{ id: 'mostStreamed', label: 'Popular Albums', visible: false, source: 'qobuz' },
|
||||||
|
{ id: 'qobuzissimes', label: 'Qobuzissimes', visible: false, source: 'qobuz' },
|
||||||
|
{ id: 'editorPicks', label: "Editor's Picks", visible: false, source: 'qobuz' },
|
||||||
{ id: 'recentAlbums', label: 'Recently Played', visible: true, source: 'ml' },
|
{ id: 'recentAlbums', label: 'Recently Played', visible: true, source: 'ml' },
|
||||||
{ id: 'continueTracks', label: 'Continue Listening', visible: true, source: 'ml' },
|
{ id: 'continueTracks', label: 'Continue Listening', visible: true, source: 'ml' },
|
||||||
{ id: 'topArtists', label: 'Your Top Artists', visible: true, source: 'ml' },
|
{ id: 'topArtists', label: 'Your Top Artists', visible: true, source: 'ml' },
|
||||||
|
|||||||
Reference in new issue
Block a user