feat(models): move combined-search result types to qbz-models

SearchAllResults and MostPopularItem now live in qbz-models; the Tauri
helpers re-export them under the legacy V2 aliases so command code and
its response serialization are unchanged.

cc
This commit is contained in:
vicrodh committed 2026-05-19 10:51:14 -06:00
1 parent 862d408789
commit 1e17032d03
3 files changed
+31 -19

No files matched your search

+2
View File
@@ -111,6 +111,8 @@ pub use types::{
Quality,
RawPlaylistTag,
ReleasesGridResponse,
MostPopularItem,
SearchAllResults,
SearchResults,
SearchResultsPage,
SessionStartResponse,
+22
View File
@@ -665,6 +665,28 @@ pub struct SearchResultsPage<T> {
pub limit: u32,
}
/// One entry of the Qobuz `most_popular` block in a combined search.
/// Serde tagging matches the legacy `V2MostPopularItem` so the Tauri
/// command's response shape is unchanged.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(tag = "type", content = "content", rename_all = "lowercase")]
pub enum MostPopularItem {
Tracks(Track),
Albums(Album),
Artists(Artist),
}
/// Combined search result: the four category pages plus an optional
/// "most popular" hero entry.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SearchAllResults {
pub albums: SearchResultsPage<Album>,
pub tracks: SearchResultsPage<Track>,
pub artists: SearchResultsPage<Artist>,
pub playlists: SearchResultsPage<Playlist>,
pub most_popular: Option<MostPopularItem>,
}
/// Favorites container
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Favorites {