mirror of
https://github.com/librespot-org/librespot.git
synced 2024-12-18 17:11:53 +00:00
Remove unused code from example
This commit is contained in:
parent
ba85875ec3
commit
06b83fee6b
1 changed files with 2 additions and 33 deletions
|
@ -1,4 +1,3 @@
|
||||||
#[macro_use]
|
|
||||||
extern crate log;
|
extern crate log;
|
||||||
extern crate env_logger;
|
extern crate env_logger;
|
||||||
|
|
||||||
|
@ -18,37 +17,7 @@ use librespot::core::session::Session;
|
||||||
use librespot::core::spotify_id::SpotifyId;
|
use librespot::core::spotify_id::SpotifyId;
|
||||||
use librespot::playback::config::PlayerConfig;
|
use librespot::playback::config::PlayerConfig;
|
||||||
use librespot::playback::config::Bitrate;
|
use librespot::playback::config::Bitrate;
|
||||||
use librespot::metadata::{FileFormat, Metadata, Track, Album, Artist, Playlist};
|
use librespot::metadata::{Metadata, Track, Playlist};
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
fn make_list_playlist(core: &mut Core, session: &Session, uri: &str) -> TrackList {
|
|
||||||
let mut tracks = Vec::new();
|
|
||||||
let mut fnames = Vec::new();
|
|
||||||
|
|
||||||
let plist_uri = SpotifyId::from_base62(&uri).unwrap();
|
|
||||||
let plist = core.run(Playlist::get(&session, plist_uri)).unwrap();
|
|
||||||
println!("album name: {}",plist.name);
|
|
||||||
let plist_name = &plist.name;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for (i, track_id) in plist.tracks.iter().enumerate() {
|
|
||||||
let plist_track = core.run(Track::get(&session, *track_id)).unwrap();
|
|
||||||
//println!("album track: {} - {}",i+1, alb_track.name);
|
|
||||||
let artist = core.run(Artist::get(&session, plist_track.artists[0])).unwrap();
|
|
||||||
println!("track artist: {}",artist.name);
|
|
||||||
tracks.push(plist_track.id);
|
|
||||||
let filename = format!("{} - {}.ogg",&artist.name, alb_track.name);
|
|
||||||
fnames.push(filename);
|
|
||||||
}
|
|
||||||
let ntr = plist.tracks.len();
|
|
||||||
|
|
||||||
let folder = format!("{}",plist_name);
|
|
||||||
let mut tlist = TrackList::new(ntr, folder, tracks, fnames);
|
|
||||||
tlist
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
env_logger::init();
|
env_logger::init();
|
||||||
|
@ -67,7 +36,7 @@ fn main() {
|
||||||
let password = args[2].to_owned();
|
let password = args[2].to_owned();
|
||||||
let credentials = Credentials::with_password(username, password);
|
let credentials = Credentials::with_password(username, password);
|
||||||
|
|
||||||
let mut uri_split = args[3].split(":");
|
let uri_split = args[3].split(":");
|
||||||
let uri_parts: Vec<&str> = uri_split.collect();
|
let uri_parts: Vec<&str> = uri_split.collect();
|
||||||
println!("{}, {}, {}",uri_parts[0], uri_parts[1], uri_parts[2]);
|
println!("{}, {}, {}",uri_parts[0], uri_parts[1], uri_parts[2]);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue