mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-30 03:55:40 +00:00
Fixed an issue where stale gamelist entries could get displayed.
This commit is contained in:
parent
68f40f7247
commit
c2d3719edf
|
@ -44,7 +44,7 @@ FileData* findOrCreateFile(SystemData* system, const std::string& path, FileType
|
|||
treeNode = children.at(key);
|
||||
}
|
||||
|
||||
// This is the end
|
||||
// This is the end.
|
||||
if (path_it == --pathList.end()) {
|
||||
if (found)
|
||||
return treeNode;
|
||||
|
@ -54,6 +54,19 @@ FileData* findOrCreateFile(SystemData* system, const std::string& path, FileType
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
// Handle the special situation where a file exists and has an entry in the
|
||||
// gamelist.xml file but the file extension is not configured in es_systems.xml.
|
||||
const std::vector<std::string> extensions =
|
||||
system->getSystemEnvData()->mSearchExtensions;
|
||||
|
||||
if (std::find(extensions.cbegin(), extensions.cend(),
|
||||
Utils::FileSystem::getExtension(path)) == extensions.cend()) {
|
||||
LOG(LogWarning) << "File \"" << path
|
||||
<< "\" is present in gamelist.xml but the extension is not "
|
||||
"configured in es_systems.xml";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
FileData* file = new FileData(type, path, system->getSystemEnvData(), system);
|
||||
|
||||
// Skipping arcade assets from gamelist.
|
||||
|
|
Loading…
Reference in a new issue