use serde::Deserialize; #[derive(Debug, Deserialize)] #[serde(rename_all = "kebab-case")] pub struct SubsonicResponseOuter { pub subsonic_response: SubsonicResponse, } #[derive(Debug, Deserialize)] #[serde(rename_all = "kebab-case", tag = "status")] pub enum SubsonicResponse { Ok { #[serde(flatten)] inner: T, }, Failed { error: Error, }, } #[derive(Debug, Deserialize)] pub struct Error { pub code: u32, pub message: String, } #[derive(Debug, Deserialize)] #[serde(rename_all = "camelCase")] pub struct RandomSongsOuter { pub random_songs: RandomSongs, } #[derive(Debug, Deserialize)] pub struct RandomSongs { pub song: Vec, } #[derive(Debug, Deserialize)] #[serde(rename_all = "camelCase")] pub struct Child { pub id: String, pub title: String, pub album: String, pub artist: String, pub track: Option, pub year: Option, pub starred: Option>, // TODO: check which is best // applicable pub duration: u64, //pub play_count: Option, pub genre: Option, pub cover_art: String, }