J'ai continué à tester la parti concernant l'écriture du fichier gamelist.xml :
- Création manuellement d'un fichier gamelist.xml concernant des informations sur 3 roms snes : le fichier est chargé correctement par EmulationStation.
- Ajout d'un favori (une rom snes : Asterix & Obelix (E)) depuis l'interface EmulationStation.
- Exécution de la commande /etc/init.d/S31emulationstation stop via ssh.
- EmulationStation produit un fichier gamelist.xml.xml (l'extension apparaît 2 fois) avec les 3 roms snes initialement présente dans le fichier gamelist.xml puis y ajoute la balise ci-contre : <folder><path>"./Asterix && Obelix (E).zip"</path></folder> juste avant la balise </gameList>.
- voici la log correspondante :
lvl2: Saved gamelist.xml for system Super Nintendo Entertainment System. Updated items: 1/56
lvl2: EmulationStation cleanly shutting down. - Exécution de la commande /etc/init.d/S31emulationstation start via ssh.
- Le favoris a disparu : normal puisque EmulationStation charge le fichier gamelist.xml qui n'a pas été mise à jour (de toute façon la syntaxe dans le fichier gamelist.xml.xml n'est pas correcte).
J'ai commencé à regarder du côté de la classe Gamelist.cpp mais je suis pas assez bon en C++ :
/*
* Write the list.
* At this point, we're sure at least one node has been updated (or added and updated).
*/
boost::filesystem::path xmlWritePath(system->getGamelistPath(true) + ".xml");
boost::filesystem::create_directories(xmlWritePath.parent_path());
try
{
pt::write_xml(xmlWritePath.generic_string(), document, std::locale("en_US.UTF8"));
LOG(LogInfo) << "Saved gamelist.xml for system " << system->getFullName() << ". Updated items: " << fileLinks.size() << "/" << fileData.size();
}
catch (std::exception &e)
{
LOG(LogError) << "Failed to save " << xmlWritePath.generic_string() << " : " << e.what();
}