Upgrade rspotify to 0.11.6

Passing IDs to rspotify still feels a little wonky with their `Id` changes
making use of `Cow`. Maybe it can be simplified on our end, but it's a start.

Fixes #844

See also:

https://github.com/ramsayleung/rspotify/pull/332
This commit is contained in:
Henrik Friedrichsen
2022-12-14 21:12:08 +01:00
parent 7063c9a9aa
commit 23e9ecfd5c
3 changed files with 115 additions and 117 deletions

View File

@@ -141,6 +141,19 @@ impl From<&PlayableItem> for Playable {
}
}
impl From<&Playable> for rspotify::prelude::PlayableId<'_> {
fn from(p: &Playable) -> Self {
match p {
Playable::Track(t) => rspotify::prelude::PlayableId::Track(
rspotify::model::TrackId::from_id(t.id.clone().unwrap()).unwrap(),
),
Playable::Episode(e) => rspotify::prelude::PlayableId::Episode(
rspotify::model::EpisodeId::from_id(e.id.clone()).unwrap(),
),
}
}
}
impl fmt::Display for Playable {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {