Enabled scraping for folders and changed file info to lowercase.

This commit is contained in:
Leon Styhre 2020-07-28 21:08:17 +02:00
parent b60c86e40f
commit afe5d98c39
4 changed files with 7 additions and 9 deletions

View file

@ -39,6 +39,7 @@ const std::vector<MetaDataDecl> gameMDD(gameDecls, gameDecls +
MetaDataDecl folderDecls[] = { MetaDataDecl folderDecls[] = {
{"name", MD_STRING, "", false, "name", "enter game name", true}, {"name", MD_STRING, "", false, "name", "enter game name", true},
{"desc", MD_MULTILINE_STRING, "", false, "description", "enter description", true}, {"desc", MD_MULTILINE_STRING, "", false, "description", "enter description", true},
{"rating", MD_RATING, "0", false, "rating", "enter rating", true},
{"developer", MD_STRING, "unknown", false, "developer", "enter game developer", true}, {"developer", MD_STRING, "unknown", false, "developer", "enter game developer", true},
{"publisher", MD_STRING, "unknown", false, "publisher", "enter game publisher", true}, {"publisher", MD_STRING, "unknown", false, "publisher", "enter game publisher", true},
{"genre", MD_STRING, "unknown", false, "genre", "enter game genre", true}, {"genre", MD_STRING, "unknown", false, "genre", "enter game genre", true},

View file

@ -572,7 +572,7 @@ FileData* SystemData::getRandomGame(const FileData* currentGame)
std::vector<FileData*> noFolderList; std::vector<FileData*> noFolderList;
for (auto it = childrenList.cbegin(); it != childrenList.cend(); it++) { for (auto it = childrenList.cbegin(); it != childrenList.cend(); it++) {
if ((*it)->getType() == GAME) if ((*it)->getType() == GAME || (*it)->getParent()->getOnlyFoldersFlag())
noFolderList.push_back((*it)); noFolderList.push_back((*it));
} }
gameList.erase(gameList.cbegin(), gameList.cend()); gameList.erase(gameList.cbegin(), gameList.cend());

View file

@ -57,8 +57,8 @@ GuiMetaDataEd::GuiMetaDataEd(
mTitle = std::make_shared<TextComponent>(mWindow, "EDIT METADATA", mTitle = std::make_shared<TextComponent>(mWindow, "EDIT METADATA",
Font::get(FONT_SIZE_LARGE), 0x555555FF, ALIGN_CENTER); Font::get(FONT_SIZE_LARGE), 0x555555FF, ALIGN_CENTER);
mSubtitle = std::make_shared<TextComponent>(mWindow, mSubtitle = std::make_shared<TextComponent>(mWindow,
Utils::String::toUpper(Utils::FileSystem::getFileName(scraperParams.game-> Utils::FileSystem::getFileName(scraperParams.game->
getPath())), Font::get(FONT_SIZE_SMALL), 0x777777FF, ALIGN_CENTER); getPath()), Font::get(FONT_SIZE_SMALL), 0x777777FF, ALIGN_CENTER);
mHeaderGrid->setEntry(mTitle, Vector2i(0, 1), false, true); mHeaderGrid->setEntry(mTitle, Vector2i(0, 1), false, true);
mHeaderGrid->setEntry(mSubtitle, Vector2i(0, 3), false, true); mHeaderGrid->setEntry(mSubtitle, Vector2i(0, 3), false, true);
@ -228,11 +228,9 @@ GuiMetaDataEd::GuiMetaDataEd(
std::vector<std::shared_ptr<ButtonComponent>> buttons; std::vector<std::shared_ptr<ButtonComponent>> buttons;
if (mScraperParams.game->getType() != FOLDER) { if (!scraperParams.system->hasPlatformId(PlatformIds::PLATFORM_IGNORE))
if (!scraperParams.system->hasPlatformId(PlatformIds::PLATFORM_IGNORE)) buttons.push_back(std::make_shared<ButtonComponent>(mWindow, "SCRAPE", "scrape",
buttons.push_back(std::make_shared<ButtonComponent>(mWindow, "SCRAPE", "scrape", std::bind(&GuiMetaDataEd::fetch, this)));
std::bind(&GuiMetaDataEd::fetch, this)));
}
buttons.push_back(std::make_shared<ButtonComponent>(mWindow, "SAVE", "save metadata", buttons.push_back(std::make_shared<ButtonComponent>(mWindow, "SAVE", "save metadata",
[&] { save(); delete this; })); [&] { save(); delete this; }));

View file

@ -430,7 +430,6 @@ bool ViewController::input(InputConfig* config, Input input)
// If we have previously launched a game and there is now input registered, it means // If we have previously launched a game and there is now input registered, it means
// the user is back in ES, so unset the flag to indicate that a game has been launched // the user is back in ES, so unset the flag to indicate that a game has been launched
// and update all the GUI components to reflect this. // and update all the GUI components to reflect this.
bool testbool = mWindow->getGameLaunchedState();
if (mWindow->getGameLaunchedState()) if (mWindow->getGameLaunchedState())
mWindow->unsetLaunchedGame(); mWindow->unsetLaunchedGame();
} }