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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
|
//! Playlist.
use serde::Deserialize;
use crate::creator::Creator;
/// A playlist.
#[derive(Debug, Deserialize)]
pub struct Playlist
{
/// The playlist's Deezer id.
pub id: u64,
/// The playlist's title.
pub title: String,
/// The playlist description.
pub description: String,
/// The playlist's duration (seconds).
pub duration: u64,
/// If the playlist is public or not.
pub public: bool,
/// If the playlist is the love tracks playlist.
pub is_loved_track: bool,
/// If the playlist is collaborative or not.
pub collaborative: bool,
/// Nb tracks in the playlist.
pub nb_tracks: u64,
/// Nb tracks not seen.
pub unseen_track_count: Option<u64>,
/// The number of playlist's fans.
pub fans: u64,
/// The url of the playlist on Deezer.
pub link: String,
/// The share link of the playlist on Deezer.
pub share: String,
/// The url of the playlist's cover. Add 'size' parameter to the url to change size.
/// Can be 'small', 'medium', 'big', 'xl'.
pub picture: String,
/// The url of the playlist's cover in size small.
pub picture_small: String,
/// The url of the playlist's cover in size medium.
pub picture_medium: String,
/// The url of the playlist's cover in size big.
pub picture_big: String,
/// The url of the playlist's cover in size xl.
pub picture_xl: String,
/// The checksum for the track list.
pub checksum: String,
/// The creator of the playlist.
pub creator: Creator,
/// List of tracks.
pub tracks: PlaylistTracks,
}
/// A track in a playlist.
#[derive(Debug, Deserialize)]
pub struct PlaylistTrack
{
/// The track's Deezer id
pub id: u64,
/// true if the track is readable in the player for the current user
pub readable: bool,
/// The track's fulltitle
pub title: String,
/// The track's short title
pub title_short: String,
/// The track version
pub title_version: String,
/// The track unseen status
pub unseen: Option<bool>,
/// The url of the track on Deezer
pub link: String,
/// The track's duration in seconds
pub duration: u64,
/// The track's Deezer rank
pub rank: u64,
/// Whether the track contains explicit lyrics
pub explicit_lyrics: bool,
/// The url of track's preview file. This file contains the first 30 seconds of the
/// track
pub preview: String,
/// The time when the track has been added to the playlist
pub time_add: u64,
/// The track's artist.
pub artist: PlaylistTrackArtist,
/// The track's album.
pub album: PlaylistTrackAlbum,
}
/// The artist of a playlist track.
#[derive(Debug, Deserialize)]
pub struct PlaylistTrackArtist
{
/// Artist id.
pub id: u64,
/// Artist name.
pub name: String,
/// Artist url.
pub link: String,
}
/// The album of a playlist track.
#[derive(Debug, Deserialize)]
pub struct PlaylistTrackAlbum
{
/// Album id.
pub id: u64,
/// Album title.
pub title: String,
/// Album cover.
pub cover: String,
/// Album cover in size small.
pub cover_small: String,
/// Album cover in size medium.
pub cover_medium: String,
/// Album cover in size big.
pub cover_big: String,
/// Album cover in side xl.
pub cover_xl: String,
}
/// Tracks in a playlist.
#[derive(Debug, Deserialize)]
pub struct PlaylistTracks
{
/// Tracks.
pub data: Vec<PlaylistTrack>,
}
|