feat: add support for Spotify albums & playlists #1

Merged
polpetta merged 6 commits from v0.2.0 into master 2021-11-15 10:03:24 +01:00
2 changed files with 6 additions and 9 deletions
Showing only changes of commit 63eb891f91 - Show all commits

View File

@ -1,6 +1,3 @@
use std::time::Duration;
use aspotify::Client;
use teloxide::prelude::*; use teloxide::prelude::*;
use spotify::SpotifyKind::Track; use spotify::SpotifyKind::Track;

View File

@ -39,17 +39,17 @@ pub fn get_spotify_client() -> Box<Client> {
spotify_client spotify_client
} }
struct TrackInfo { pub struct TrackInfo {
name: String, pub(crate) name: String,
artists: Vec<String>, pub(crate) artists: Vec<String>,
duration: Duration, pub(crate) duration: Duration,
} }
struct AlbumInfo { pub struct AlbumInfo {
pub(crate) name: String, pub(crate) name: String,
pub(crate) artists: Vec<String>, pub(crate) artists: Vec<String>,
pub(crate) genres: Vec<String>, pub(crate) genres: Vec<String>,
songs: Vec<TrackInfo>, pub(crate) songs: Vec<TrackInfo>,
} }
pub async fn get_spotify_track(spotify: Box<Client>, id: &String) -> Option<TrackInfo> { pub async fn get_spotify_track(spotify: Box<Client>, id: &String) -> Option<TrackInfo> {