Skip to content

Commit

Permalink
Upgrade rspotify to 0.11.6
Browse files Browse the repository at this point in the history
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:

ramsayleung/rspotify#332
  • Loading branch information
hrkfdn committed Dec 14, 2022
1 parent 7063c9a commit 23e9ecf
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 117 deletions.
79 changes: 46 additions & 33 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions src/model/playable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading

0 comments on commit 23e9ecf

Please sign in to comment.