Skip to content

Commit

Permalink
website/api/v1: add a queue update if thread update occurs
Browse files Browse the repository at this point in the history
  • Loading branch information
Wessie committed Jun 19, 2024
1 parent 00bca87 commit baf21d5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions website/api/v1/sse.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ func (a *API) runStatusUpdates(ctx context.Context) {
return
}

if status.Thread != previous.Thread {
// TODO: add an actual sendThread as well
// TODO: see if we need this hack at all
// send a queue after a thread update, since our default theme
// uses the queue template for the thread location
go a.sendQueue(ctx)
}

// only pass an update through if the song is different from the previous one
if !status.Song.EqualTo(previous.Song) {
log.Debug().Str("event", EventMetadata).Any("value", status).Msg("sending")
Expand Down

0 comments on commit baf21d5

Please sign in to comment.