Skip to content

Commit

Permalink
fix tracks context not playable (#625)
Browse files Browse the repository at this point in the history
  • Loading branch information
aome510 authored Dec 1, 2024
1 parent f7bd1f8 commit 5087bde
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion spotify_player/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "spotify_player"
version = "0.20.2"
version = "0.20.3"
authors = ["Thang Pham <phamducthang1234@gmail.com>"]
edition = "2021"
license = "MIT"
Expand Down
12 changes: 8 additions & 4 deletions spotify_player/src/event/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,14 @@ fn handle_command_for_track_table_window(
filtered_tracks[id].id.uri()
};

let base_playback = if let Some(context_id) = context_id {
Playback::Context(context_id, None)
} else {
Playback::URIs(tracks.iter().map(|t| t.id.clone().into()).collect(), None)
let base_playback = match context_id {
None | Some(ContextId::Tracks(_)) => {
Playback::URIs(tracks.iter().map(|t| t.id.clone().into()).collect(), None)
}
Some(ContextId::Show(_)) => unreachable!(
"show context should be handled by handle_command_for_episode_table_window"
),
Some(context_id) => Playback::Context(context_id, None),
};

client_pub.send(ClientRequest::Player(PlayerRequest::StartPlayback(
Expand Down

0 comments on commit 5087bde

Please sign in to comment.