Skip to content

Commit

Permalink
fix: keep skipping tracks after a track_end
Browse files Browse the repository at this point in the history
This commit fixes the issue where after a "track_end", CogLink would keep sending play requests till the queue was empty.
  • Loading branch information
ThePedroo committed May 14, 2024
1 parent f3b8cd5 commit 6b4a3e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/websocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ void _ws_on_text(void *data, struct websockets *ws, struct ws_info *info, const

struct coglink_player_queue *queue = coglink_get_player_queue(c_info->c_client, player);

if (queue->size != 0) {
if (queue->size != 0 && (track_end->reason == COGLINK_TRACK_END_REASON_FINISHED || track_end->reason == COGLINK_TRACK_END_REASON_LOAD_FAILED)) {
coglink_remove_track_from_queue(c_info->c_client, player, 0);

if (queue->size != 0) {
Expand Down

0 comments on commit 6b4a3e8

Please sign in to comment.