From 9af271d36f119717dfa2eca41a22509cc237682c Mon Sep 17 00:00:00 2001 From: Jools Wills Date: Fri, 8 Feb 2019 21:35:50 +0000 Subject: [PATCH] add setting for searching for local game art - defaults to off --- es-app/src/FileData.cpp | 6 +++--- es-app/src/guis/GuiMenu.cpp | 5 +++++ es-core/src/Settings.cpp | 2 ++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/es-app/src/FileData.cpp b/es-app/src/FileData.cpp index c9c5330b8..1e07503a5 100644 --- a/es-app/src/FileData.cpp +++ b/es-app/src/FileData.cpp @@ -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++) diff --git a/es-app/src/guis/GuiMenu.cpp b/es-app/src/guis/GuiMenu.cpp index 2fd4c5f0e..534b4c437 100644 --- a/es-app/src/guis/GuiMenu.cpp +++ b/es-app/src/guis/GuiMenu.cpp @@ -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(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(mWindow); hidden_files->setState(Settings::getInstance()->getBool("ShowHiddenFiles")); diff --git a/es-core/src/Settings.cpp b/es-core/src/Settings.cpp index 6e808d127..1a38ae5d2 100644 --- a/es-core/src/Settings.cpp +++ b/es-core/src/Settings.cpp @@ -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";