Skip to content

Commit

Permalink
Fixed incorrect play behaviour when paused. Resolves #4
Browse files Browse the repository at this point in the history
  • Loading branch information
nick42d committed Nov 30, 2023
1 parent d461447 commit 326efae
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/app/server/player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,16 @@ pub fn spawn_rodio_thread(
sink.stop()
}
sink.append(source);
// Handle case we're we've received a play message but queue was paused.
if sink.is_paused() {
sink.play();
}
debug!("Now playing {:?}", id);
// Send the Now Playing message for good orders sake to avoid synchronization issues.
blocking_send_or_error(
&response_tx,
super::Response::Player(Response::Playing(song_id, id)),
);
cur_song_elapsed = Duration::default();
cur_song_id = song_id;
thinks_is_playing = true;
Expand Down

0 comments on commit 326efae

Please sign in to comment.