mirror of
https://github.com/librespot-org/librespot.git
synced 2025-10-03 09:49:31 +02:00
Re-Add ability to handle/play tracks (#1468)
* re-add support to play a set of tracks * connect: reduce some cloning * connect: derive clone for LoadRequest * apply review, improve function naming * clippy fix
This commit is contained in:
parent
e2c3ac3146
commit
8b729540f4
6 changed files with 213 additions and 85 deletions
|
@ -1,4 +1,4 @@
|
|||
use crate::context::Context;
|
||||
use crate::{context::Context, context_page::ContextPage, context_track::ContextTrack};
|
||||
use protobuf::Message;
|
||||
use std::hash::{Hash, Hasher};
|
||||
|
||||
|
@ -11,3 +11,27 @@ impl Hash for Context {
|
|||
}
|
||||
|
||||
impl Eq for Context {}
|
||||
|
||||
impl From<Vec<String>> for ContextPage {
|
||||
fn from(value: Vec<String>) -> Self {
|
||||
ContextPage {
|
||||
tracks: value
|
||||
.into_iter()
|
||||
.map(|uri| ContextTrack {
|
||||
uri: Some(uri),
|
||||
..Default::default()
|
||||
})
|
||||
.collect(),
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Vec<ContextTrack>> for ContextPage {
|
||||
fn from(tracks: Vec<ContextTrack>) -> Self {
|
||||
ContextPage {
|
||||
tracks,
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue