diff --git a/es-app/src/MiximageGenerator.cpp b/es-app/src/MiximageGenerator.cpp index 2ebbb2f48..0dbbc760a 100644 --- a/es-app/src/MiximageGenerator.cpp +++ b/es-app/src/MiximageGenerator.cpp @@ -43,6 +43,7 @@ void MiximageGenerator::startThread(std::promise* miximagePromise) if (mGame->getMiximagePath() != "" && !Settings::getInstance()->getBool("MiximageOverwrite")) { LOG(LogDebug) << "MiximageGenerator::MiximageGenerator(): File already exists and miximage " "overwriting has not been enabled, aborting"; + mResult = true; mMiximagePromise->set_value(true); return; } @@ -50,7 +51,8 @@ void MiximageGenerator::startThread(std::promise* miximagePromise) if ((mScreenshotPath = mGame->getScreenshotPath()) == "") { LOG(LogDebug) << "MiximageGenerator::MiximageGenerator(): " "No screenshot image found, aborting"; - mResultMessage = "NO SCREENSHOT IMAGE FOUND, COULDN'T GENERATE MIXIMAGE"; + mResultMessage = "No screenshot image found, couldn't generate miximage"; + mResult = true; mMiximagePromise->set_value(true); return; } @@ -97,6 +99,7 @@ void MiximageGenerator::startThread(std::promise* miximagePromise) (endTime - startTime).count() << " ms"; } + mResult = false; mResultMessage = mMessage; mMiximagePromise->set_value(false); } @@ -128,7 +131,7 @@ bool MiximageGenerator::generateImage() if (fileFormat == FIF_UNKNOWN) { LOG(LogError) << "Screenshot image in unknown image format, aborting"; - mMessage = "SCREENSHOT IMAGE IN UNKNOWN FORMAT, COULDN'T GENERATE MIXIMAGE"; + mMessage = "Screenshot image in unknown format, couldn't generate miximage"; return true; } @@ -143,13 +146,13 @@ bool MiximageGenerator::generateImage() } else { LOG(LogError) << "Screenshot file format not supported"; - mMessage = "SCREENSHOT IMAGE IN UNSUPPORTED FORMAT, COULDN'T GENERATE MIXIMAGE"; + mMessage = "Screenshot image in unsupported format, couldn't generate miximage"; return true; } if (!screenshotFile) { LOG(LogError) << "Error loading screenshot image, corrupt file?"; - mMessage = "ERROR LOADING SCREENSHOT IMAGE, COULDN'T GENERATE MIXIMAGE"; + mMessage = "Error loading screenshot image, couldn't generate miximage"; return true; } @@ -187,7 +190,7 @@ bool MiximageGenerator::generateImage() #endif if (!marqueeFile) { LOG(LogError) << "Couldn't load marquee image, corrupt file?"; - mMessage = "ERROR LOADING MARQUEE IMAGE, CORRUPT FILE?"; + mMessage = "Error loading marquee image, corrupt file?"; mMarquee = false; } } @@ -226,7 +229,7 @@ bool MiximageGenerator::generateImage() #endif if (!boxFile) { LOG(LogError) << "Couldn't load 3D box image, corrupt file?"; - mMessage = "ERROR LOADING 3D BOX IMAGE, CORRUPT FILE?"; + mMessage = "Error loading 3d box image, corrupt file?"; mBox3D = false; } } @@ -265,7 +268,7 @@ bool MiximageGenerator::generateImage() #endif if (!boxFile) { LOG(LogError) << "Couldn't load box cover image, corrupt file?"; - mMessage = "ERROR LOADING BOX COVER IMAGE, CORRUPT FILE?"; + mMessage = "Error loading box cover image, corrupt file?"; mCover = false; } } diff --git a/es-app/src/guis/GuiScraperSearch.cpp b/es-app/src/guis/GuiScraperSearch.cpp index 129dbf430..91852befc 100644 --- a/es-app/src/guis/GuiScraperSearch.cpp +++ b/es-app/src/guis/GuiScraperSearch.cpp @@ -318,6 +318,7 @@ void GuiScraperSearch::updateViewStyle() void GuiScraperSearch::search(const ScraperSearchParams& params) { mBlockAccept = true; + mMiximageResult = false; mScrapeResult = {}; mResultList->clear(); @@ -339,6 +340,7 @@ void GuiScraperSearch::stop() mMDRetrieveURLsHandle.reset(); mMiximageGenerator.reset(); mBlockAccept = false; + mMiximageResult = false; mScrapeResult = {}; } @@ -663,11 +665,11 @@ void GuiScraperSearch::update(int deltaTime) // Only wait one millisecond, this update() function runs very frequently. if (mGeneratorFuture.wait_for(std::chrono::milliseconds(1)) == std::future_status::ready) { mMDResolveHandle.reset(); + // We always let the miximage generator thread complete. + mMiximageGeneratorThread.join(); if (!mMiximageResult) mScrapeResult.savedNewMedia = true; returnResult(mScrapeResult); - // We always let the miximage generator thread complete. - mMiximageGeneratorThread.join(); mMiximageGenerator.reset(); } }