Remove unused code from metadata lib

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

View file

@ -146,30 +146,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)] #[derive(Debug, Clone)]
pub struct Track { pub struct Track {
pub id: SpotifyId, pub id: SpotifyId,