mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 14:15:38 +00:00
Added option to scrape based on the metadata name.
This commit is contained in:
parent
aee2f6bd59
commit
96da134f7d
|
@ -1,4 +1,4 @@
|
||||||
# EmulationStation Desktop Edition - User Guide
|
# EmulationStation Desktop Edition v1.0.0 - User Guide
|
||||||
|
|
||||||
**Note:** This document is intended as a quick start guide, for more in-depth information and details on how to compile EmulationStation and perform more advanced configuration, please refer to the [INSTALL.md](INSTALL.md) document.
|
**Note:** This document is intended as a quick start guide, for more in-depth information and details on how to compile EmulationStation and perform more advanced configuration, please refer to the [INSTALL.md](INSTALL.md) document.
|
||||||
|
|
||||||
|
@ -542,6 +542,12 @@ The region to scrape for, affects game names.
|
||||||
|
|
||||||
Currently only English or World are supported, not really significant at the moment.
|
Currently only English or World are supported, not really significant at the moment.
|
||||||
|
|
||||||
|
**Search using metadata name**
|
||||||
|
|
||||||
|
By default ES will perform scraper searches based on the game name that has been manually set in the metadata editor, or that has been previously scraped. If you prefer to search using the physical name of the game file or directory, then turn off this option. The default game name will correspond to the name of the physical file or directory, so for the first scraping of any given game, this option makes no difference.
|
||||||
|
|
||||||
|
Note that when using TheGamesDB as scraper service for arcade games (MAME/Neo Geo), the short MAME name will always be expanded to the full game name as this scraper does not properly support searches using MAME names. Also note that you need to save the game name in the metadata editor before you can use it for scraping.
|
||||||
|
|
||||||
**Overwrite files and data**
|
**Overwrite files and data**
|
||||||
|
|
||||||
Affects both overwriting of metadata as well as actual game media files on the filesystem.
|
Affects both overwriting of metadata as well as actual game media files on the filesystem.
|
||||||
|
|
|
@ -266,6 +266,14 @@ void GuiScraperMenu::openOtherSettings()
|
||||||
scraper_language->getParent()->getChildCount()-2)->setOpacity(DISABLED_OPACITY);
|
scraper_language->getParent()->getChildCount()-2)->setOpacity(DISABLED_OPACITY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Search using metadata name.
|
||||||
|
auto scrape_metadata_name = std::make_shared<SwitchComponent>(mWindow);
|
||||||
|
scrape_metadata_name->setState(Settings::getInstance()->getBool("ScraperSearchMetadataName"));
|
||||||
|
s->addWithLabel("SEARCH USING METADATA NAME", scrape_metadata_name);
|
||||||
|
s->addSaveFunc([scrape_metadata_name] {
|
||||||
|
Settings::getInstance()->setBool("ScraperSearchMetadataName",
|
||||||
|
scrape_metadata_name->getState()); });
|
||||||
|
|
||||||
// Overwrite files and data.
|
// Overwrite files and data.
|
||||||
auto scrape_overwrite = std::make_shared<SwitchComponent>(mWindow);
|
auto scrape_overwrite = std::make_shared<SwitchComponent>(mWindow);
|
||||||
scrape_overwrite->setState(Settings::getInstance()->getBool("ScraperOverwriteData"));
|
scrape_overwrite->setState(Settings::getInstance()->getBool("ScraperOverwriteData"));
|
||||||
|
|
|
@ -632,23 +632,33 @@ void GuiScraperSearch::openInputScreen(ScraperSearchParams& params)
|
||||||
|
|
||||||
stop();
|
stop();
|
||||||
|
|
||||||
if (params.system->hasPlatformId(PlatformIds::ARCADE) ||
|
std::string searchString;
|
||||||
params.system->hasPlatformId(PlatformIds::NEOGEO)) {
|
|
||||||
mWindow->pushGui(new GuiTextEditPopup(mWindow, getHelpStyle(), "REFINE SEARCH",
|
if (params.nameOverride.empty()) {
|
||||||
// Initial value is last search if there was one, otherwise the clean path name.
|
// If the setting to search based on metadata name has been set, then show this string
|
||||||
// If it's a MAME or Neo Geo game, expand the game name accordingly.
|
// regardless of whether the entry is an arcade game and TheGamesDB is used.
|
||||||
params.nameOverride.empty() ?
|
if (Settings::getInstance()->getBool("ScraperSearchMetadataName")) {
|
||||||
MameNames::getInstance()->getCleanName(params.game->getCleanName()) :
|
searchString = params.game->metadata.get("name");
|
||||||
params.nameOverride,
|
|
||||||
searchForFunc, false, "SEARCH", "APPLY CHANGES?"));
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
mWindow->pushGui(new GuiTextEditPopup(mWindow, getHelpStyle(), "REFINE SEARCH",
|
// If searching based on the actual file name, then expand to the full game name
|
||||||
// Initial value is last search if there was one, otherwise the clean path name.
|
// in case the scraper is set to TheGamesDB and it's an arcade game. This is required
|
||||||
params.nameOverride.empty() ? params.game->getCleanName() : params.nameOverride,
|
// as TheGamesDB has issues with searches using the short MAME names.
|
||||||
searchForFunc, false, "SEARCH", "APPLY CHANGES?"));
|
if (Settings::getInstance()->getString("Scraper") == "thegamesdb" &&
|
||||||
|
(params.system->hasPlatformId(PlatformIds::ARCADE) ||
|
||||||
|
params.system->hasPlatformId(PlatformIds::NEOGEO)))
|
||||||
|
searchString = MameNames::getInstance()->getCleanName(params.game->getCleanName());
|
||||||
|
else
|
||||||
|
searchString = params.game->getCleanName();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
searchString = params.nameOverride;
|
||||||
|
}
|
||||||
|
|
||||||
|
mWindow->pushGui(new GuiTextEditPopup(mWindow, getHelpStyle(), "REFINE SEARCH",
|
||||||
|
searchString, searchForFunc, false, "SEARCH", "APPLY CHANGES?"));
|
||||||
|
}
|
||||||
|
|
||||||
bool GuiScraperSearch::saveMetadata(
|
bool GuiScraperSearch::saveMetadata(
|
||||||
const ScraperSearchResult& result, MetaDataList& metadata)
|
const ScraperSearchResult& result, MetaDataList& metadata)
|
||||||
|
|
|
@ -137,13 +137,19 @@ void thegamesdb_generate_json_scraper_requests(
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (cleanName.empty()) {
|
if (cleanName.empty()) {
|
||||||
// If it's an arcade game (MAME or Neo Geo) then use the regular name.
|
// If the setting to search based on the metadata name has been set, then search
|
||||||
if (params.system->hasPlatformId(PlatformIds::ARCADE) ||
|
// using this regardless of whether the entry is an arcade game.
|
||||||
params.system->hasPlatformId(PlatformIds::NEOGEO)) {
|
if (Settings::getInstance()->getBool("ScraperSearchMetadataName")) {
|
||||||
cleanName = params.game->getName();
|
cleanName = params.game->metadata.get("name");
|
||||||
cleanName = MameNames::getInstance()->getCleanName(params.game->getCleanName());
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
// If not searching based on the metadata name, then check whether it's an
|
||||||
|
// arcade game and if so expand to the full game name. This is required as
|
||||||
|
// TheGamesDB has issues with searching using the short MAME names.
|
||||||
|
if (params.system->hasPlatformId(PlatformIds::ARCADE) ||
|
||||||
|
params.system->hasPlatformId(PlatformIds::NEOGEO))
|
||||||
|
cleanName = MameNames::getInstance()->getCleanName(params.game->getCleanName());
|
||||||
|
else
|
||||||
cleanName = params.game->getCleanName();
|
cleanName = params.game->getCleanName();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -159,10 +159,15 @@ void screenscraper_generate_scraper_requests(const ScraperSearchParams& params,
|
||||||
|
|
||||||
ScreenScraperRequest::ScreenScraperConfig ssConfig;
|
ScreenScraperRequest::ScreenScraperConfig ssConfig;
|
||||||
|
|
||||||
if (params.nameOverride == "")
|
if (params.nameOverride == "") {
|
||||||
path = ssConfig.getGameSearchUrl(params.game->getCleanName());
|
if (Settings::getInstance()->getBool("ScraperSearchMetadataName"))
|
||||||
|
path = ssConfig.getGameSearchUrl(params.game->metadata.get("name"));
|
||||||
else
|
else
|
||||||
|
path = ssConfig.getGameSearchUrl(params.game->getCleanName());
|
||||||
|
}
|
||||||
|
else {
|
||||||
path = ssConfig.getGameSearchUrl(params.nameOverride);
|
path = ssConfig.getGameSearchUrl(params.nameOverride);
|
||||||
|
}
|
||||||
|
|
||||||
auto& platforms = params.system->getPlatformIds();
|
auto& platforms = params.system->getPlatformIds();
|
||||||
std::vector<unsigned short> p_ids;
|
std::vector<unsigned short> p_ids;
|
||||||
|
|
|
@ -161,6 +161,7 @@ void Settings::setDefaults()
|
||||||
// mBoolMap["ScraperGenerateThumbnails"] = false;
|
// mBoolMap["ScraperGenerateThumbnails"] = false;
|
||||||
mBoolMap["ScraperInteractive"] = true;
|
mBoolMap["ScraperInteractive"] = true;
|
||||||
mBoolMap["ScraperSemiautomatic"] = true;
|
mBoolMap["ScraperSemiautomatic"] = true;
|
||||||
|
mBoolMap["ScraperSearchMetadataName"] = true;
|
||||||
mBoolMap["ScraperOverwriteData"] = true;
|
mBoolMap["ScraperOverwriteData"] = true;
|
||||||
mBoolMap["ScraperRespectExclusions"] = true;
|
mBoolMap["ScraperRespectExclusions"] = true;
|
||||||
mBoolMap["ScraperExcludeRecursively"] = true;
|
mBoolMap["ScraperExcludeRecursively"] = true;
|
||||||
|
|
Loading…
Reference in a new issue