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:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user