Remove unused code from metadata lib

This commit is contained in:
HEnquist 2019-08-06 22:04:27 +02:00 committed by henenq
parent ae0585eb5b
commit d72eb38d62

View file

@ -141,30 +141,6 @@ pub trait Metadata: Send + Sized + 'static {
}
}
pub trait PlaylistMeta: Send + Sized + 'static {
type Message: protobuf::Message;
fn base_url() -> &'static str;
fn parse(msg: &Self::Message, session: &Session) -> Self;
fn get(session: &Session, id: SpotifyId, user: String, start: i32, len: i32) -> Box<Future<Item = Self, Error = MercuryError>> {
//let uri = format!("hm://playlist/{}?from={}&length={}",id.to_base62(), 0, 100);
//let uri = format!("hm://playlist/user/{}/playlist/{}?from={}&length={}", user, id.to_base62(), start, len);
let uri = format!("hm://playlist/v2/playlist/{}", id.to_base62());
println!("request uri: {}", uri);
let request = session.mercury().get(uri);
println!("a");
let session = session.clone();
Box::new(request.and_then(move |response| {
println!("{:?}", response);
let data = response.payload.first().expect("Empty payload");
let msg: Self::Message = protobuf::parse_from_bytes(data).unwrap();
println!("{:?}", msg);
Ok(Self::parse(&msg, &session))
}))
}
}
#[derive(Debug, Clone)]
pub struct Track {
pub id: SpotifyId,