Fix #496: Persist repeat mode setting across restarts

This commit is contained in:
Drew Weymouth
2025-01-01 14:23:02 -08:00
parent 16d8cb4a58
commit 6572e74aa8
8 changed files with 46 additions and 8 deletions
+7
View File
@@ -78,6 +78,7 @@ func NewPlaybackEngine(
ctx context.Context,
s *ServerManager,
p player.BasePlayer,
playbackCfg *PlaybackConfig,
scrobbleCfg *ScrobbleConfig,
transcodeCfg *TranscodingConfig,
) *playbackEngine {
@@ -92,6 +93,12 @@ func NewPlaybackEngine(
nowPlayingIdx: -1,
wasStopped: true,
}
switch playbackCfg.RepeatMode {
case "All":
pm.loopMode = LoopAll
case "One":
pm.loopMode = LoopOne
}
p.OnTrackChange(pm.handleOnTrackChange)
p.OnSeek(func() {
pm.doUpdateTimePos(true)