Removed an unnecessary metadata name check in FileData.

This commit is contained in:
Leon Styhre 2022-12-20 18:42:28 +01:00
parent a54d6a5568
commit 15cb3a0525

View file

@ -47,7 +47,6 @@ FileData::FileData(FileType type,
, mDeletionFlag {false} , mDeletionFlag {false}
{ {
// Metadata needs at least a name field (since that's what getName() will return). // Metadata needs at least a name field (since that's what getName() will return).
if (metadata.get("name").empty()) {
if ((system->hasPlatformId(PlatformIds::ARCADE) || if ((system->hasPlatformId(PlatformIds::ARCADE) ||
system->hasPlatformId(PlatformIds::SNK_NEO_GEO)) && system->hasPlatformId(PlatformIds::SNK_NEO_GEO)) &&
metadata.getType() != FOLDER_METADATA) { metadata.getType() != FOLDER_METADATA) {
@ -55,14 +54,12 @@ FileData::FileData(FileType type,
metadata.set("name", MameNames::getInstance().getCleanName(getCleanName())); metadata.set("name", MameNames::getInstance().getCleanName(getCleanName()));
} }
else { else {
if (metadata.getType() == FOLDER_METADATA && Utils::FileSystem::isHidden(mPath)) { if (metadata.getType() == FOLDER_METADATA && Utils::FileSystem::isHidden(mPath))
metadata.set("name", Utils::FileSystem::getFileName(mPath)); metadata.set("name", Utils::FileSystem::getFileName(mPath));
} else
else {
metadata.set("name", getDisplayName()); metadata.set("name", getDisplayName());
} }
}
}
mSystemName = system->getName(); mSystemName = system->getName();
metadata.resetChangedFlag(); metadata.resetChangedFlag();
} }