fix build after merge

Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
Deluan 2026-01-23 16:52:21 -05:00
parent 853afec2fd
commit 82b1bd26ad

View File

@ -112,6 +112,7 @@ func (api *Router) setStar(ctx context.Context, star bool, ids ...string) error
return nil
}
event := &events.RefreshResource{}
broadcastToAll := false
err := api.ds.WithTxImmediate(func(tx model.DataStore) error {
for _, id := range ids {
exist, err := tx.Album(ctx).Exists(id)
@ -149,7 +150,7 @@ func (api *Router) setStar(ctx context.Context, star bool, ids ...string) error
}
event = event.With("playlist", "*")
// Ensure the refresh event is sent to all clients, including the originator
ctx = events.BroadcastToAll(ctx)
broadcastToAll = true
continue
}
err = tx.MediaFile(ctx).SetStar(star, id)
@ -158,7 +159,11 @@ func (api *Router) setStar(ctx context.Context, star bool, ids ...string) error
}
event = event.With("song", id)
}
api.broker.SendMessage(ctx, event)
if broadcastToAll {
api.broker.SendBroadcastMessage(ctx, event)
} else {
api.broker.SendMessage(ctx, event)
}
return nil
})
if err != nil {