Skip to content

Commit 5087bde

Browse files
authored
fix tracks context not playable (#625)
1 parent f7bd1f8 commit 5087bde

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

spotify_player/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "spotify_player"
3-
version = "0.20.2"
3+
version = "0.20.3"
44
authors = ["Thang Pham <[email protected]>"]
55
edition = "2021"
66
license = "MIT"

spotify_player/src/event/window.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,14 @@ fn handle_command_for_track_table_window(
304304
filtered_tracks[id].id.uri()
305305
};
306306

307-
let base_playback = if let Some(context_id) = context_id {
308-
Playback::Context(context_id, None)
309-
} else {
310-
Playback::URIs(tracks.iter().map(|t| t.id.clone().into()).collect(), None)
307+
let base_playback = match context_id {
308+
None | Some(ContextId::Tracks(_)) => {
309+
Playback::URIs(tracks.iter().map(|t| t.id.clone().into()).collect(), None)
310+
}
311+
Some(ContextId::Show(_)) => unreachable!(
312+
"show context should be handled by handle_command_for_episode_table_window"
313+
),
314+
Some(context_id) => Playback::Context(context_id, None),
311315
};
312316

313317
client_pub.send(ClientRequest::Player(PlayerRequest::StartPlayback(

0 commit comments

Comments
 (0)