diff --git a/USERGUIDE.md b/USERGUIDE.md index b21906014..192bba9ad 100644 --- a/USERGUIDE.md +++ b/USERGUIDE.md @@ -784,7 +784,7 @@ Can be set to Disabled, Default, Enhanced or Instant. Set to Disabled by default **When to save metadata** -The metadata for a game is updated both by scraping and modifying data in the metadata editor, but also when launching a game, as the play count and last played date is then updated. This settings enabled you to define when to write such metadata changes to the gamelist.xml files. Setting the option to "Never" will disable writing to these files altogether, except for some special conditions such as when a game is manually deleted using the metadata editor. In theory "On exit" will give some performance gains, but it's normally recommended to leave the setting at its default value which is "Always". +The metadata for a game is updated both by scraping and modifying data in the metadata editor, but also when launching a game, as the play count and last played date is then updated. This setting enables you to define when to write such metadata changes to the gamelist.xml files. Setting the option to "Never" will disable writing to these files altogether, except for some special conditions such as when a game is manually deleted using the metadata editor, or when scraping using the multi-scraper (the multi-scraper will always save any updates immediately to the gamelist.xml files). In theory "On exit" will give some performance gains, but it's normally recommended to leave the setting at its default value which is "Always". Note that with the settings set to "Never", any updates such as the last played date will still be shown on screen, however during the next application startup, any values previously saved to the gamelist.xml files will be read in again. **Game media directory** diff --git a/es-app/src/Gamelist.cpp b/es-app/src/Gamelist.cpp index 43b614094..be990a7fc 100644 --- a/es-app/src/Gamelist.cpp +++ b/es-app/src/Gamelist.cpp @@ -275,20 +275,19 @@ void updateGamelist(SystemData* system) // Add the game to the file, unless it's flagged for deletion. if (!(*fit)->getDeletionFlag()) { addFileDataNode(root, *fit, tag, system); + (*fit)->metadata.resetChangedFlag(); ++numUpdated; } } // Now write the file. if (numUpdated > 0) { - const auto startTs = std::chrono::system_clock::now(); - // Make sure the folders leading up to this path exist (or the write will fail). std::string xmlWritePath(system->getGamelistPath(true)); Utils::FileSystem::createDirectory(Utils::FileSystem::getParent(xmlWritePath)); - LOG(LogInfo) << "Added/Updated " << numUpdated << - " entities in '" << xmlReadPath << "'"; + LOG(LogDebug) << "Gamelist::updateGamelist(): Added/updated " << numUpdated << + (numUpdated == 1 ? " entity in '" : " entities in '") << xmlReadPath << "'"; #if defined(_WIN64) if (!doc.save_file(Utils::String::stringToWideString(xmlWritePath).c_str())) { @@ -298,11 +297,6 @@ void updateGamelist(SystemData* system) LOG(LogError) << "Error saving gamelist.xml to \"" << xmlWritePath << "\" (for system " << system->getName() << ")!"; } - - const auto endTs = std::chrono::system_clock::now(); - LOG(LogInfo) << "Saved gamelist.xml for system \"" << system->getName() << "\" in " << - std::chrono::duration_cast - (endTs - startTs).count() << " ms"; } } else {