diff --git a/Cargo.lock b/Cargo.lock index 629e798..54fcb26 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2651,6 +2651,7 @@ dependencies = [ "form_urlencoded", "idna", "percent-encoding", + "serde", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 485b56e..ccdb9ec 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ serde = { version = "1.0.214", features = ["derive"] } tokio = { version = "1", features = ["rt-multi-thread"] } tracing = { version = "0.1.40", default-features = false, features = ["attributes", "std"] } tracing-subscriber = "0.3.18" -url = "2.5.2" +url = { version = "2.5.2", features = ["serde"] } zbus = { version = "5.0.1", features = ["chrono"] } [build-dependencies] diff --git a/src/subsonic/schema.rs b/src/subsonic/schema.rs index ef27b1f..fff37bf 100644 --- a/src/subsonic/schema.rs +++ b/src/subsonic/schema.rs @@ -1,5 +1,6 @@ use chrono::{offset::Utc, DateTime}; use serde::Deserialize; +use url::Url; #[derive(Debug, Deserialize)] #[serde(rename_all = "kebab-case")] @@ -82,3 +83,27 @@ pub struct AlbumID3 { pub played: Option>, // TODO: opensubsonic extensions? } + +#[derive(Debug, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SearchResults3Outer { + pub search_results3: SearchResults3, +} + +#[derive(Debug, Deserialize)] +pub struct SearchResults3 { + pub artist: Option>, + pub album: Option>, + pub song: Option>, +} + +#[derive(Debug, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ArtistID3 { + pub id: String, + pub name: String, + pub cover_art: Option, + pub artist_image_url: Option, + pub album_count: Option, + pub starred: Option>, +}