Repository navigation
Fix "Save each run as new playlist" toggle never saving - #1
Merged
Merged
Conversation
The toggle in PlaylistCard reverts immediately and the setting is never
persisted.
saveReplacePlaylist() posted {name, replace}, but HandleSaveReplacePlaylist
reads body.ID to resolve the playlist:
if def, ok := defs.PlaylistDefs[body.ID]; ok {
} else if defs.CustomIDRe.MatchString(body.ID) {
} else {
http.Error(w, "unknown playlist name", http.StatusBadRequest)
body.ID was always empty, so every request 400'd. Settings.jsx treats a
failed save as a signal to roll back its optimistic update, which is why
the toggle flips back on its own.
Send {id, name, replace} instead, matching saveSchedule() -- whose handler
resolves the playlist the same way and already receives both fields. The
handler needs id to look up the playlist definition and name to derive the
env prefix for custom playlists.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013ZuEbqv1CGbPub9kB3g2s4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings the fix from upstream PR LumePart#229 into this fork's
dev, so it lands in theghcr.io/gabriel-lewis/explo:devimage we actually run.Cause
saveReplacePlaylist()posted{name, replace}, butHandleSaveReplacePlaylistresolves the playlist frombody.ID:body.IDwas always empty, so every save returned 400, andSettings.jsxrolled back its optimistic update — making the toggle appear to revert on its own.Fix
Send
{id, name, replace}, matchingsaveSchedule(), whose handler resolves the playlist the same way and already receives both fields.Testing
npm run buildinsrc/web/frontendsucceeds. Only one caller ofsaveReplacePlaylistexists, ands.nameis already in scope there.Workaround until this is deployed: add
--replace-playlist=falseto the relevant*_FLAGSvar in.env.