mirror of
https://github.com/navidrome/navidrome.git
synced 2026-05-03 06:51:16 +00:00
fix build after merge
Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
parent
853afec2fd
commit
82b1bd26ad
@ -112,6 +112,7 @@ func (api *Router) setStar(ctx context.Context, star bool, ids ...string) error
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
event := &events.RefreshResource{}
|
event := &events.RefreshResource{}
|
||||||
|
broadcastToAll := false
|
||||||
err := api.ds.WithTxImmediate(func(tx model.DataStore) error {
|
err := api.ds.WithTxImmediate(func(tx model.DataStore) error {
|
||||||
for _, id := range ids {
|
for _, id := range ids {
|
||||||
exist, err := tx.Album(ctx).Exists(id)
|
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", "*")
|
event = event.With("playlist", "*")
|
||||||
// Ensure the refresh event is sent to all clients, including the originator
|
// Ensure the refresh event is sent to all clients, including the originator
|
||||||
ctx = events.BroadcastToAll(ctx)
|
broadcastToAll = true
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
err = tx.MediaFile(ctx).SetStar(star, id)
|
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)
|
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
|
return nil
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user