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 spotify::SpotifyKind::Track;

View File

@ -39,17 +39,17 @@ pub fn get_spotify_client() -> Box<Client> {
spotify_client
}
struct TrackInfo {
name: String,
artists: Vec<String>,
duration: Duration,
pub struct TrackInfo {
pub(crate) name: String,
pub(crate) artists: Vec<String>,
pub(crate) duration: Duration,
}
struct AlbumInfo {
pub struct AlbumInfo {
pub(crate) name: String,
pub(crate) artists: 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> {