Skip to content

Commit 6af908b

Browse files
committed
fix: manually unset player options based on disallow restrictions
1 parent 80aab19 commit 6af908b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

cmd/daemon/controls.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,16 @@ func (p *AppPlayer) loadContext(ctx context.Context, spotCtx *connectpb.Context,
240240
p.state.player.Restrictions = spotCtx.Restrictions
241241
p.state.player.ContextRestrictions = spotCtx.Restrictions
242242

243+
if len(spotCtx.Restrictions.DisallowTogglingShuffleReasons) > 0 {
244+
p.state.player.Options.ShufflingContext = false
245+
}
246+
if len(spotCtx.Restrictions.DisallowTogglingRepeatTrackReasons) > 0 {
247+
p.state.player.Options.RepeatingTrack = false
248+
}
249+
if len(spotCtx.Restrictions.DisallowTogglingRepeatContextReasons) > 0 {
250+
p.state.player.Options.RepeatingContext = false
251+
}
252+
243253
if p.state.player.ContextMetadata == nil {
244254
p.state.player.ContextMetadata = map[string]string{}
245255
}

0 commit comments

Comments
 (0)