2024-11-01 08:29:59 +00:00
|
|
|
use serde::Deserialize;
|
|
|
|
|
|
|
|
#[derive(Debug, Deserialize)]
|
|
|
|
#[serde(rename_all = "kebab-case")]
|
|
|
|
pub struct SubsonicResponseOuter<T> {
|
|
|
|
pub subsonic_response: SubsonicResponse<T>,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug, Deserialize)]
|
|
|
|
#[serde(rename_all = "kebab-case", tag = "status")]
|
|
|
|
pub enum SubsonicResponse<T> {
|
|
|
|
Ok {
|
|
|
|
#[serde(flatten)]
|
|
|
|
inner: T,
|
|
|
|
},
|
|
|
|
Failed {
|
|
|
|
error: Error,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug, Deserialize)]
|
|
|
|
pub struct Error {
|
|
|
|
pub code: u32,
|
|
|
|
pub message: String,
|
|
|
|
}
|
2024-11-01 08:43:55 +00:00
|
|
|
|
|
|
|
#[derive(Debug, Deserialize)]
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
pub struct RandomSongsOuter {
|
|
|
|
pub random_songs: RandomSongs,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug, Deserialize)]
|
|
|
|
pub struct RandomSongs {
|
|
|
|
pub song: Vec<Child>,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug, Deserialize)]
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
pub struct Child {
|
|
|
|
pub id: String,
|
|
|
|
pub title: String,
|
|
|
|
pub album: String,
|
|
|
|
pub artist: String,
|
2024-11-01 12:55:47 +00:00
|
|
|
pub track: Option<u32>,
|
|
|
|
pub year: Option<u32>,
|
2024-11-01 08:43:55 +00:00
|
|
|
pub starred: Option<()>,
|
|
|
|
pub duration: u64,
|
|
|
|
pub play_count: Option<u32>,
|
|
|
|
pub genre: Option<String>,
|
|
|
|
pub cover_art: String,
|
|
|
|
}
|