tbd search results

This commit is contained in:
Erica Z 2024-11-10 15:36:11 +01:00
parent 25f082ee6f
commit cdff5c0e48
3 changed files with 27 additions and 1 deletions

1
Cargo.lock generated
View file

@ -2651,6 +2651,7 @@ dependencies = [
"form_urlencoded",
"idna",
"percent-encoding",
"serde",
]
[[package]]

View file

@ -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]

View file

@ -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<DateTime<Utc>>,
// 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<Vec<ArtistID3>>,
pub album: Option<Vec<AlbumID3>>,
pub song: Option<Vec<Child>>,
}
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ArtistID3 {
pub id: String,
pub name: String,
pub cover_art: Option<String>,
pub artist_image_url: Option<Url>,
pub album_count: Option<u32>,
pub starred: Option<DateTime<Utc>>,
}