parent
cea5958e43
commit
63eb891f91
|
@ -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;
|
||||||
|
|
|
@ -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> {
|
||||||
|
|
Loading…
Reference in New Issue