Skip to content

Commit

Permalink
Playlist saving bugfix.
Browse files Browse the repository at this point in the history
Fixes #3324
  • Loading branch information
blazoncek committed Aug 16, 2023
1 parent a2bda5a commit bf452e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wled00/playlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ int16_t loadPlaylist(JsonObject playlistObj, byte presetId) {
if (playlistEndPreset == 255 && currentPreset > 0) playlistEndPreset = currentPreset;
if (playlistEndPreset > 250) playlistEndPreset = 0;
shuffle = shuffle || playlistObj["r"];
if (shuffle) playlistOptions += PL_OPTION_SHUFFLE;
if (shuffle) playlistOptions |= PL_OPTION_SHUFFLE;

currentPlaylist = presetId;
DEBUG_PRINTLN(F("Playlist loaded."));
Expand Down Expand Up @@ -156,7 +156,7 @@ void serializePlaylist(JsonObject sObj) {
JsonArray ps = playlist.createNestedArray("ps");
JsonArray dur = playlist.createNestedArray("dur");
JsonArray transition = playlist.createNestedArray(F("transition"));
playlist[F("repeat")] = (playlistIndex < 0) ? playlistRepeat - 1 : playlistRepeat; // remove added repetition count (if not yet running)
playlist[F("repeat")] = (playlistIndex < 0 && playlistRepeat > 0) ? playlistRepeat - 1 : playlistRepeat; // remove added repetition count (if not yet running)
playlist["end"] = playlistEndPreset;
playlist["r"] = playlistOptions & PL_OPTION_SHUFFLE;
for (int i=0; i<playlistLen; i++) {
Expand Down

0 comments on commit bf452e9

Please sign in to comment.