diff options
author | alyx <alyx@aleteoryx.me> | 2024-04-01 20:27:44 -0400 |
---|---|---|
committer | alyx <alyx@aleteoryx.me> | 2024-04-01 20:27:44 -0400 |
commit | 83ba4fe37a1184b998be09b9cbe53a22c7ba9e3b (patch) | |
tree | c60c2c17caeed24db920dee4613c1e185b12d12b /src/deserialize.rs | |
parent | 22c2e4e2db9ad9d892ed5fb63d92254677f6dafd (diff) | |
download | lfm_embed-83ba4fe37a1184b998be09b9cbe53a22c7ba9e3b.tar.gz lfm_embed-83ba4fe37a1184b998be09b9cbe53a22c7ba9e3b.tar.bz2 lfm_embed-83ba4fe37a1184b998be09b9cbe53a22c7ba9e3b.zip |
Move caching to src/cache/; Finalize API parsing fixes
Font and user cache code has been moved to special files, independant from src/config.rs
API parsing changes have been properly tested, and last.fm API JSON is now trace-logged for debugging convenience.
Diffstat (limited to 'src/deserialize.rs')
-rw-r--r-- | src/deserialize.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/deserialize.rs b/src/deserialize.rs index 9606258..0134ae5 100644 --- a/src/deserialize.rs +++ b/src/deserialize.rs @@ -82,16 +82,15 @@ pub enum ImageSize { #[derive(Deserialize, Debug)] pub struct Image { pub size: ImageSize, - #[serde(rename = "#text")] + #[serde(alias = "#text")] pub url: Arc<str>, } #[derive(Deserialize, Debug)] pub struct Album { - #[serde(rename = "mbid")] - pub uuid: Arc<str>, - #[serde(rename = "#text")] - pub name: Arc<str>, + pub mbid: Option<Arc<str>>, + #[serde(alias = "#text")] + pub title: Arc<str>, #[serde(default)] #[serde(rename = "image")] pub images: Vec<Image>, @@ -102,9 +101,10 @@ pub struct Album { #[derive(Deserialize, Debug)] pub struct Track { pub artist: Artist, - #[serde(rename = "image")] + #[serde(alias = "image")] + #[serde(default)] pub images: Vec<Image>, - pub mbid: Arc<str>, + pub mbid: Option<Arc<str>>, pub album: Album, pub name: Arc<str>, pub url: Arc<str>, @@ -138,7 +138,7 @@ pub struct TrackAttr { } #[derive(Deserialize, Debug)] pub struct ArtistStub { - #[serde(rename = "#text")] + #[serde(alias = "#text")] pub name: Arc<str> } #[derive(Deserialize, Debug)] |