From 15c06b0d4c3f16a782b2823b6d31bb169ab08652 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Wed, 18 Oct 2023 17:56:27 +0200 Subject: [PATCH] Changed GuiOrphanedDataCleanup to not purge some folder entries if hidden games are not shown --- es-app/src/guis/GuiOrphanedDataCleanup.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/es-app/src/guis/GuiOrphanedDataCleanup.cpp b/es-app/src/guis/GuiOrphanedDataCleanup.cpp index b39f30a08..15ff155fd 100644 --- a/es-app/src/guis/GuiOrphanedDataCleanup.cpp +++ b/es-app/src/guis/GuiOrphanedDataCleanup.cpp @@ -440,6 +440,12 @@ void GuiOrphanedDataCleanup::cleanupGamelists() { LOG(LogInfo) << "GuiOrphanedDataCleanup: Starting cleanup of gamelist.xml files"; + if (!Settings::getInstance()->getBool("ShowHiddenGames")) { + LOG(LogWarning) + << "The \"Show hidden games\" setting is disabled, this may lead to some orphaned " + "folder entries not getting purged"; + } + const std::time_t currentTime { std::chrono::system_clock::to_time_t(std::chrono::system_clock::now())}; @@ -595,6 +601,10 @@ void GuiOrphanedDataCleanup::cleanupGamelists() ++removeCount; } } + else if (!Settings::getInstance()->getBool("ShowHiddenGames")) { + // Don't remove entries for existing folders if not displaying hidden games. + targetRoot.append_copy((*it)); + } else { bool folderExists {false}; for (auto child : system->getRootFolder()->getChildrenRecursive()) {