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
use serde::{Deserialize, Serialize};

#[derive(Clone, Debug, Deserialize)]
pub struct Lyrics {
    pub total: u64,
    pub took: u64,
    pub data: Vec<LyricsData>
}

#[derive(Clone, Debug, Deserialize)]
pub struct LyricsData {
    pub artist: String,
    pub artist_id: u64,
    pub album: String,
    pub album_ids: String,
    pub album_year: String,
    pub name: String,
    pub lyrics: String,
    pub search_str: String,
    pub album_art: String,
    pub popularity: u64,
    pub singalong: Vec<LyricsSingalong>,
    pub meta: LyricsMeta,
    pub id: String,
    pub search_score: f64,
    pub url: String
}

#[derive(Clone, Debug, Deserialize)]
pub struct LyricsSingalong {
    pub lrc_timestamp: Option<String>,
    pub milliseconds: Option<String>,
    pub duration: Option<String>,
    pub line: Option<String>
}

#[derive(Clone, Debug, Deserialize)]
pub struct LyricsMeta {
    pub spotify: SpotifyMeta,
    pub deezer: DeezerMeta,
    pub artists: Option<Vec<ArtistsMeta>>,
    pub other: OtherMeta
}

#[derive(Clone, Debug, Deserialize)]
pub struct SpotifyMeta {
    pub artists: Vec<String>,
    pub track: Option<String>,
    pub album: Option<String>
}

#[derive(Clone, Debug, Deserialize)]
pub struct DeezerMeta {
    pub artists: Vec<String>,
    pub track: Option<String>,
    pub album: Option<String>
}

#[derive(Clone, Debug, Deserialize)]
pub struct ArtistsMeta {
    pub name: String,
    pub is_primary: bool,
    pub id: u64
}

#[derive(Clone, Debug, Deserialize)]
pub struct OtherMeta {
    pub gain: f64,
    pub bpm: f64
}

#[derive(Clone, Debug, Serialize)]
pub struct MusicRecommendations {
    pub tracks: Vec<String>,
    pub provider: String,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub youtube_token: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub limit: Option<u32>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub recommend_type: Option<String>,
}

#[derive(Clone, Debug, Deserialize)]
pub struct MusicRecommendationsResponse {
    pub provider: String,
    pub total: u32,
    pub tracks: Vec<RecommendationTrack>
}

#[derive(Clone, Debug, Deserialize)]
pub struct RecommendationTrack {
    pub youtube: YoutubeTrack,
    pub spotify: SpotifyTrack,
    pub name: String
}

#[derive(Clone, Debug, Deserialize)]
pub struct SpotifyTrack {
    pub id: String,
    pub album: SpotifyAlbum,
    pub artists: Vec<SpotifyArtist>,
    pub name: String,
    pub link: String
}

#[derive(Clone, Debug, Deserialize)]
pub struct SpotifyArtist {
    pub name: String,
    pub link: String
}

#[derive(Clone, Debug, Deserialize)]
pub struct SpotifyAlbum {
    pub name: String,
    pub album_art: String,
    pub link: String
}

#[derive(Clone, Debug, Deserialize)]
pub struct YoutubeTrack {
    pub id: String,
    pub link: String,
    pub title: String,
    pub thumbnail: String,
    pub description: String,
}