index.html is now served from SPIFFS. You can add rfid tag -> folder mappings via the webinterface. And I've added the missing controller json data messages.

This commit is contained in:
2019-11-17 00:35:23 +01:00
parent b9a4770ff2
commit 5c15a7d4cb
6 changed files with 95 additions and 16 deletions

View File

@@ -110,3 +110,19 @@ String PlaylistManager::json() {
}
return json.as<String>();
}
bool PlaylistManager::add_mapping(String id, String folder) {
DEBUG("Adding Mapping: '%s'=>'%s'\n", id.c_str(), folder.c_str());
if (!SD.exists(folder)) return false;
File ids = SD.open(folder + "/ids.txt", "a");
String data = "\n";
data += id;
data += '\n';
char* buffer = new char[data.length()];
data.toCharArray(buffer, data.length());
ids.write((uint8_t *)buffer, data.length());
delete buffer;
ids.close();
_map[id] = folder;
return true;
}