Don't read all dirs at startup.
This commit is contained in:
@@ -6,6 +6,7 @@ PlaylistManager::PlaylistManager() {
|
||||
SPIMaster::enable_sd();
|
||||
current_rfid_tag_id = String("");
|
||||
|
||||
/*
|
||||
File root = SD.open("/");
|
||||
while(File entry = root.openNextFile()) {
|
||||
if (entry.isDirectory()) {
|
||||
@@ -17,6 +18,8 @@ PlaylistManager::PlaylistManager() {
|
||||
}
|
||||
}
|
||||
}
|
||||
root.close();
|
||||
*/
|
||||
|
||||
if (!SD.exists("/_mapping.txt")) {
|
||||
Serial.println("WARNING: /_mapping.txt not found!");
|
||||
@@ -37,7 +40,7 @@ PlaylistManager::PlaylistManager() {
|
||||
Serial.printf(" Adding mapping: %s=>%s\n", rfid_id.c_str(), folder.c_str());
|
||||
map[rfid_id] = folder;
|
||||
|
||||
if (folder.charAt(0)=='/') {
|
||||
/*if (folder.charAt(0)=='/') {
|
||||
bool found=false;
|
||||
for (String f: dirs) {
|
||||
if (f.equals(folder)) {
|
||||
@@ -48,12 +51,11 @@ PlaylistManager::PlaylistManager() {
|
||||
if (!found) {
|
||||
Serial.printf("WARNING: Found mapping for RFID id %s which maps to non-existing folder %s!\n", rfid_id.c_str(), folder.c_str());
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
f.close();
|
||||
}
|
||||
root.close();
|
||||
}
|
||||
|
||||
Playlist PlaylistManager::get_playlist(String rfid_id) {
|
||||
|
||||
Reference in New Issue
Block a user