From 15cb3a052560899295c21303af8ef044d3a44e06 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Tue, 20 Dec 2022 18:42:28 +0100 Subject: [PATCH] Removed an unnecessary metadata name check in FileData. --- es-app/src/FileData.cpp | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/es-app/src/FileData.cpp b/es-app/src/FileData.cpp index 9315e0795..65ca82427 100644 --- a/es-app/src/FileData.cpp +++ b/es-app/src/FileData.cpp @@ -47,22 +47,19 @@ FileData::FileData(FileType type, , mDeletionFlag {false} { // Metadata needs at least a name field (since that's what getName() will return). - if (metadata.get("name").empty()) { - if ((system->hasPlatformId(PlatformIds::ARCADE) || - system->hasPlatformId(PlatformIds::SNK_NEO_GEO)) && - metadata.getType() != FOLDER_METADATA) { - // If it's a MAME or Neo Geo game, expand the game name accordingly. - metadata.set("name", MameNames::getInstance().getCleanName(getCleanName())); - } - else { - if (metadata.getType() == FOLDER_METADATA && Utils::FileSystem::isHidden(mPath)) { - metadata.set("name", Utils::FileSystem::getFileName(mPath)); - } - else { - metadata.set("name", getDisplayName()); - } - } + if ((system->hasPlatformId(PlatformIds::ARCADE) || + system->hasPlatformId(PlatformIds::SNK_NEO_GEO)) && + metadata.getType() != FOLDER_METADATA) { + // If it's a MAME or Neo Geo game, expand the game name accordingly. + metadata.set("name", MameNames::getInstance().getCleanName(getCleanName())); } + else { + if (metadata.getType() == FOLDER_METADATA && Utils::FileSystem::isHidden(mPath)) + metadata.set("name", Utils::FileSystem::getFileName(mPath)); + else + metadata.set("name", getDisplayName()); + } + mSystemName = system->getName(); metadata.resetChangedFlag(); }