Added and clarified startup log warnings for missing or invalid es_systems.xml platform tags.

This commit is contained in:
Leon Styhre 2021-07-10 13:07:44 +02:00
parent 717eb98a6e
commit e000e23f64

View file

@ -466,6 +466,12 @@ bool SystemData::loadConfig()
// Platform ID list // Platform ID list
const std::string platformList = const std::string platformList =
Utils::String::toLower(system.child("platform").text().get()); Utils::String::toLower(system.child("platform").text().get());
if (platformList == "") {
LOG(LogWarning) << "No platform defined for system \"" << name
<< "\", scraper searches will be inaccurate";
}
std::vector<std::string> platformStrs = readList(platformList); std::vector<std::string> platformStrs = readList(platformList);
std::vector<PlatformIds::PlatformId> platformIds; std::vector<PlatformIds::PlatformId> platformIds;
for (auto it = platformStrs.cbegin(); it != platformStrs.cend(); it++) { for (auto it = platformStrs.cbegin(); it != platformStrs.cend(); it++) {
@ -483,7 +489,7 @@ bool SystemData::loadConfig()
// platforms, then generate a warning. // platforms, then generate a warning.
if (str != "" && platformId == PlatformIds::PLATFORM_UNKNOWN) if (str != "" && platformId == PlatformIds::PLATFORM_UNKNOWN)
LOG(LogWarning) << "Unknown platform \"" << str << "\" defined for system \"" LOG(LogWarning) << "Unknown platform \"" << str << "\" defined for system \""
<< name << "\""; << name << "\", scraper searches will be inaccurate";
else if (platformId != PlatformIds::PLATFORM_UNKNOWN) else if (platformId != PlatformIds::PLATFORM_UNKNOWN)
platformIds.push_back(platformId); platformIds.push_back(platformId);
} }