Skip to content

Commit 7a08fef

Browse files
committed
Do not unload playlist if called from playlist (bugfix)
1 parent d291d44 commit 7a08fef

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

wled00/presets.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,13 +182,13 @@ bool doApplyPreset(uint8_t tmpPreset, uint8_t tmpMode)
182182
//HTTP API commands
183183
const char* httpwin = fdo["win"];
184184
if (httpwin) {
185-
if (currentPlaylist && fdo["win"].as<String>().indexOf(F("NP")) < 0) unloadPlaylist(); // #5703
185+
if (currentPlaylist && presetToApply && fdo["win"].as<String>().indexOf(F("NP")) < 0) unloadPlaylist(); // presetToApply>0 means we are not called from playlist; #5703
186186
String apireq = "win"; apireq += '&'; // reduce RAM string usage
187187
apireq += httpwin;
188188
handleSet(nullptr, apireq, false); // may call applyPreset() via PL=
189189
setValuesFromFirstSelectedSeg(); // fills legacy values
190190
} else {
191-
if (currentPlaylist && fdo[F("np")].isNull()) unloadPlaylist(); // applying a preset unloads the playlist (#3827 & #5703)
191+
if (currentPlaylist && presetToApply && fdo[F("np")].isNull()) unloadPlaylist(); // applying a preset unloads the playlist if not called from playlist (#3827 & #5703)
192192
// remove load request for presets to prevent recursive crash, except if:
193193
// - called by button preset which contains preset cycling string "1~5~"
194194
// - or boot preset (i.e. with preset chaining like {"lor":2,"udpn":{"send":true},"MultiRelay":{"relay":1,"on":true},"ps":"1~5r"})

0 commit comments

Comments
 (0)