summaryrefslogtreecommitdiffstats
path: root/src/lastfm/api_types.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lastfm/api_types.rs')
-rw-r--r--src/lastfm/api_types.rs44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/lastfm/api_types.rs b/src/lastfm/api_types.rs
new file mode 100644
index 0000000..28b593a
--- /dev/null
+++ b/src/lastfm/api_types.rs
@@ -0,0 +1,44 @@
+#![allow(non_camel_case_types)]
+
+#[derive(Deserialize)]
+pub struct track_artist {
+ #[serde(rename = "#text")]
+ pub text: String,
+}
+
+#[derive(Deserialize)]
+pub struct track_album {
+ #[serde(rename = "#text")]
+ pub text: String,
+}
+
+#[derive(Deserialize)]
+pub struct track_date {
+ pub uts: String, // no idea why this is a string either
+}
+
+#[derive(Deserialize)]
+pub struct track {
+ pub artist: track_artist,
+ pub name: String,
+ pub album: track_album,
+ pub date: track_date,
+}
+
+#[derive(Deserialize)]
+pub struct recent_tracks_recenttracks_attr {
+ pub total: String, // no idea why this is a string
+}
+
+#[derive(Deserialize)]
+pub struct recent_tracks_recenttracks {
+ pub track: Vec<track>,
+ #[serde(rename = "@attr")]
+ pub attr: recent_tracks_recenttracks_attr,
+}
+
+#[derive(Deserialize)]
+pub struct recent_tracks {
+ pub recenttracks: recent_tracks_recenttracks,
+}
+