@@ -64,7 +64,8 @@ void Config::init() {
6464 ssidsCount = 0 ;
6565 _cardStatus = CS_NONE;
6666 _SDplaylistFS = getMode ()==PM_SDCARD?&SD:(true ?&SPIFFS:_SDplaylistFS);
67- if (SDC_CS!=255 ) randomSeed (analogRead (SDC_CS));
67+ // if(SDC_CS!=255) randomSeed(analogRead(SDC_CS));
68+ randomSeed (esp_random ());
6869 backupSDStation = 0 ;
6970 // checkSD();
7071 _bootDone=false ;
@@ -162,6 +163,7 @@ void Config::changeMode(int newmode){
162163 delay (10 );
163164 delay (50 );
164165 }
166+ if (getMode ()==PM_WEB) player.setResumeFilePos (0 );
165167 initPlaylistMode ();
166168 if (store.smartstart == 1 ) player.sendCommand ({PR_PLAY, store.lastStation });
167169 // else
@@ -661,23 +663,25 @@ uint8_t Config::fillPlMenu(int from, uint8_t count, bool fromNextion) {
661663 playlist.seek (pos, SeekSet);
662664 sdog.giveMutex ();
663665 }
664- while (playlist.available ()) {
666+ bool pla = true ;
667+ while (pla) {
665668 sdog.takeMutex ();
669+ pla = playlist.available ();
666670 String stationName = playlist.readStringUntil (' \n ' );
667671 sdog.giveMutex ();
668672 stationName = stationName.substring (0 , stationName.indexOf (' \t ' ));
669- if (config.store .numplaylist ) stationName = String (from+c)+" " +stationName;
673+ if (config.store .numplaylist && stationName. length ()> 0 ) stationName = String (from+c)+" " +stationName;
670674 if (!fromNextion) display.printPLitem (c, stationName.c_str ());
671- #ifdef USE_NEXTION
672- if (fromNextion) nextion.printPLitem (c, stationName.c_str ());
673- #endif
675+ #ifdef USE_NEXTION
676+ if (fromNextion) nextion.printPLitem (c, stationName.c_str ());
677+ #endif
674678 c++;
675679 if (c >= count) break ;
676680 }
677681 break ;
678682 }
679- return c;
680683 sdog.takeMutex ();playlist.close ();sdog.giveMutex ();
684+ return c;
681685}
682686
683687bool Config::parseCSV (const char * line, char * name, char * url, int &ovol) {
0 commit comments