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
use chrono::prelude::*;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
use crate::{Followers, Image, Page, PlayableItem, PlaylistId, PublicUser};
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, Default)]
pub struct PlaylistResult {
pub snapshot_id: String,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, Default)]
pub struct PlaylistTracksRef {
pub href: String,
pub total: u32,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
pub struct SimplifiedPlaylist {
pub collaborative: bool,
pub external_urls: HashMap<String, String>,
pub href: String,
pub id: PlaylistId,
pub images: Vec<Image>,
pub name: String,
pub owner: PublicUser,
pub public: Option<bool>,
pub snapshot_id: String,
pub tracks: PlaylistTracksRef,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
pub struct FullPlaylist {
pub collaborative: bool,
pub description: Option<String>,
pub external_urls: HashMap<String, String>,
pub followers: Followers,
pub href: String,
pub id: PlaylistId,
pub images: Vec<Image>,
pub name: String,
pub owner: PublicUser,
pub public: Option<bool>,
pub snapshot_id: String,
pub tracks: Page<PlaylistItem>,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, Default)]
pub struct PlaylistItem {
pub added_at: Option<DateTime<Utc>>,
pub added_by: Option<PublicUser>,
pub is_local: bool,
pub track: Option<PlayableItem>,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
pub struct FeaturedPlaylists {
pub message: String,
pub playlists: Page<SimplifiedPlaylist>,
}
#[derive(Deserialize)]
pub struct CategoryPlaylists {
pub playlists: Page<SimplifiedPlaylist>,
}