diff --git a/src/main.rs b/src/main.rs index d304b798..ec2fea1c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,34 +1,16 @@ -#![feature(plugin,scoped)] +#![feature(scoped)] #![allow(deprecated)] -//#![allow(unused_imports,dead_code)] -#![plugin(protobuf_macros)] -#[macro_use] extern crate lazy_static; - - -extern crate byteorder; -extern crate crypto; -extern crate gmp; -extern crate num; -extern crate portaudio; -extern crate protobuf; -extern crate shannon; -extern crate rand; -extern crate readall; -extern crate vorbis; - -#[macro_use] extern crate librespot; +extern crate librespot; use std::clone::Clone; use std::fs::File; -use std::io::{Read, Write}; +use std::io::Read; use std::path::Path; use std::thread; use std::path::PathBuf; -use librespot::metadata::{AlbumRef, ArtistRef, TrackRef}; use librespot::session::{Config, Session}; -use librespot::util::SpotifyId; use librespot::util::version::version_string; use librespot::player::Player; use librespot::spirc::SpircManager; @@ -68,28 +50,3 @@ fn main() { poll_thread.join(); } -fn print_track(session: &Session, track_id: SpotifyId) { - let track : TrackRef = session.metadata(track_id); - - let album : AlbumRef = { - let handle = track.wait(); - let data = handle.unwrap(); - eprintln!("{}", data.name); - session.metadata(data.album) - }; - - let artists : Vec = { - let handle = album.wait(); - let data = handle.unwrap(); - eprintln!("{}", data.name); - data.artists.iter().map(|id| { - session.metadata(*id) - }).collect() - }; - - for artist in artists { - let handle = artist.wait(); - let data = handle.unwrap(); - eprintln!("{}", data.name); - } -}