mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-04-10 19:15:13 +00:00
Fixed an issue where the gamelist entry would not update properly if the user aborted the single-game scraper.
This commit is contained in:
parent
3b6ace73ae
commit
dc3731660b
|
@ -76,7 +76,17 @@ GuiGameScraper::GuiGameScraper(
|
||||||
mGrid.resetCursor();
|
mGrid.resetCursor();
|
||||||
}));
|
}));
|
||||||
buttons.push_back(std::make_shared<ButtonComponent>(
|
buttons.push_back(std::make_shared<ButtonComponent>(
|
||||||
mWindow, "CANCEL", "cancel", [&] { delete this; }));
|
mWindow, "CANCEL", "cancel", [&] {
|
||||||
|
if (mSearch->getSavedNewMedia()) {
|
||||||
|
// If the user aborted the scraping but there was still some media downloaded,
|
||||||
|
// then force an unload of the textures for the game image and marquee, and make
|
||||||
|
// an update of the game entry. Otherwise the images would not get updated until
|
||||||
|
// the user scrolls up and down the gamelist.
|
||||||
|
TextureResource::manualUnload(mSearchParams.game->getImagePath(), false);
|
||||||
|
TextureResource::manualUnload(mSearchParams.game->getMarqueePath(), false);
|
||||||
|
ViewController::get()->onFileChanged(mSearchParams.game, true);
|
||||||
|
}
|
||||||
|
delete this; }));
|
||||||
mButtonGrid = makeButtonGrid(mWindow, buttons);
|
mButtonGrid = makeButtonGrid(mWindow, buttons);
|
||||||
|
|
||||||
mGrid.setEntry(mButtonGrid, Vector2i(0, 6), true, false);
|
mGrid.setEntry(mButtonGrid, Vector2i(0, 6), true, false);
|
||||||
|
@ -134,6 +144,15 @@ void GuiGameScraper::onSizeChanged()
|
||||||
bool GuiGameScraper::input(InputConfig* config, Input input)
|
bool GuiGameScraper::input(InputConfig* config, Input input)
|
||||||
{
|
{
|
||||||
if (config->isMappedTo("b", input) && input.value) {
|
if (config->isMappedTo("b", input) && input.value) {
|
||||||
|
if (mSearch->getSavedNewMedia()) {
|
||||||
|
// If the user aborted the scraping but there was still some media downloaded,
|
||||||
|
// then force an unload of the textures for the game image and marquee, and make
|
||||||
|
// an update of the game entry. Otherwise the images would not get updated until
|
||||||
|
// the user scrolls up and down the gamelist.
|
||||||
|
TextureResource::manualUnload(mSearchParams.game->getImagePath(), false);
|
||||||
|
TextureResource::manualUnload(mSearchParams.game->getMarqueePath(), false);
|
||||||
|
ViewController::get()->onFileChanged(mSearchParams.game, true);
|
||||||
|
}
|
||||||
delete this;
|
delete this;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,6 +44,8 @@ public:
|
||||||
void openInputScreen(ScraperSearchParams& from);
|
void openInputScreen(ScraperSearchParams& from);
|
||||||
void stop();
|
void stop();
|
||||||
inline SearchType getSearchType() const { return mSearchType; }
|
inline SearchType getSearchType() const { return mSearchType; }
|
||||||
|
bool getSavedNewMedia()
|
||||||
|
{ return (mMDResolveHandle ? mMDResolveHandle->getSavedNewMedia() : false); };
|
||||||
static bool saveMetadata(const ScraperSearchResult& result,
|
static bool saveMetadata(const ScraperSearchResult& result,
|
||||||
MetaDataList& metadata, FileData* scrapedGame);
|
MetaDataList& metadata, FileData* scrapedGame);
|
||||||
|
|
||||||
|
|
|
@ -179,6 +179,7 @@ public:
|
||||||
void update() override;
|
void update() override;
|
||||||
inline const ScraperSearchResult& getResult() const
|
inline const ScraperSearchResult& getResult() const
|
||||||
{ assert(mStatus == ASYNC_DONE); return mResult; }
|
{ assert(mStatus == ASYNC_DONE); return mResult; }
|
||||||
|
bool getSavedNewMedia() { return mResult.savedNewMedia; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ScraperSearchResult mResult;
|
ScraperSearchResult mResult;
|
||||||
|
|
Loading…
Reference in a new issue