add setting for searching for local game art - defaults to off

This commit is contained in:
Jools Wills 2019-02-08 21:35:50 +00:00
parent 9ae899360c
commit 9af271d36f
3 changed files with 10 additions and 3 deletions

View file

@ -54,7 +54,7 @@ const std::string FileData::getThumbnailPath() const
std::string thumbnail = metadata.get("thumbnail");
// no thumbnail, try image
if(thumbnail.empty())
if(thumbnail.empty() && Settings::getInstance()->getBool("LocalArt"))
{
thumbnail = metadata.get("image");
@ -115,7 +115,7 @@ const std::string FileData::getVideoPath() const
std::string video = metadata.get("video");
// no video, try to use local video
if(video.empty())
if(video.empty() && Settings::getInstance()->getBool("LocalArt"))
{
std::string path = mEnvData->mStartPath + "/images/" + getDisplayName() + "-video.mp4";
if(Utils::FileSystem::exists(path))
@ -130,7 +130,7 @@ const std::string FileData::getMarqueePath() const
std::string marquee = metadata.get("marquee");
// no marquee, try to use local marquee
if(marquee.empty())
if(marquee.empty() && Settings::getInstance()->getBool("LocalArt"))
{
const char* extList[2] = { ".png", ".jpg" };
for(int i = 0; i < 2; i++)

View file

@ -407,6 +407,11 @@ void GuiMenu::openOtherSettings()
s->addWithLabel("PARSE GAMESLISTS ONLY", parse_gamelists);
s->addSaveFunc([parse_gamelists] { Settings::getInstance()->setBool("ParseGamelistOnly", parse_gamelists->getState()); });
auto local_art = std::make_shared<SwitchComponent>(mWindow);
local_art->setState(Settings::getInstance()->getBool("LocalArt"));
s->addWithLabel("SEARCH FOR LOCAL ART", local_art);
s->addSaveFunc([local_art] { Settings::getInstance()->setBool("LocalArt", local_art->getState()); });
// hidden files
auto hidden_files = std::make_shared<SwitchComponent>(mWindow);
hidden_files->setState(Settings::getInstance()->getBool("ShowHiddenFiles"));

View file

@ -129,6 +129,8 @@ void Settings::setDefaults()
mBoolMap["SortAllSystems"] = false;
mBoolMap["UseCustomCollectionsSystem"] = true;
mBoolMap["LocalArt"] = false;
// Audio out device for volume control
#ifdef _RPI_
mStringMap["AudioDevice"] = "PCM";