summaryrefslogtreecommitdiffstats
path: root/src/lastfm/api_types.rs
blob: a7c37129abb1ce673205d0bda0ec64fce9758643 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]

#[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: Option<track_date>,
}

#[derive(Deserialize)]
pub struct recent_tracks_recenttracks_attr {
    pub total: String, // no idea why this is a string
    pub totalPages: 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,
}