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:
3 files changed
+31
-19
No files matched your search
@@ -111,6 +111,8 @@ pub use types::{
|
||||
Quality,
|
||||
RawPlaylistTag,
|
||||
ReleasesGridResponse,
|
||||
MostPopularItem,
|
||||
SearchAllResults,
|
||||
SearchResults,
|
||||
SearchResultsPage,
|
||||
SessionStartResponse,
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user