feat: add support for Spotify albums & playlists #1
@ -1,6 +1,3 @@
 | 
			
		||||
use std::time::Duration;
 | 
			
		||||
 | 
			
		||||
use aspotify::Client;
 | 
			
		||||
use teloxide::prelude::*;
 | 
			
		||||
 | 
			
		||||
use spotify::SpotifyKind::Track;
 | 
			
		||||
 | 
			
		||||
@ -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> {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user