feat(search): use Qobuz API most_popular field directly

Replace heuristic-based most popular detection with Qobuz's actual
most_popular field from the catalog/search endpoint.

- Add CATALOG_SEARCH endpoint path
- Make app_id() and get_http() public on QobuzClient
- Add MostPopularItem enum with tagged serialization (artists/albums/tracks)
- Update search_all to use catalog/search and parse most_popular field
- Update SearchView template to use allResults.most_popular with new types
- Add MostPopularItem type to searchState store
This commit is contained in:
vicrodh committed 2026-02-01 01:33:17 -06:00
1 parent aa16a9276b
commit d8bd93374f
5 files changed
+84 -68

No files matched your search

+7
View File
@@ -10,10 +10,17 @@ export interface SearchResults<T> {
limit: number;
}
// Most popular item from Qobuz catalog search
export type MostPopularItem<Album, Track, Artist> =
| { type: 'albums'; content: Album }
| { type: 'tracks'; content: Track }
| { type: 'artists'; content: Artist };
export interface SearchAllResults<Album, Track, Artist> {
albums: SearchResults<Album>;
tracks: SearchResults<Track>;
artists: SearchResults<Artist>;
most_popular: MostPopularItem<Album, Track, Artist> | null;
}
export interface SearchState<Album, Track, Artist> {