mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-31 04:25:40 +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();
|
||||
}));
|
||||
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);
|
||||
|
||||
mGrid.setEntry(mButtonGrid, Vector2i(0, 6), true, false);
|
||||
|
@ -134,6 +144,15 @@ void GuiGameScraper::onSizeChanged()
|
|||
bool GuiGameScraper::input(InputConfig* config, Input input)
|
||||
{
|
||||
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;
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -44,6 +44,8 @@ public:
|
|||
void openInputScreen(ScraperSearchParams& from);
|
||||
void stop();
|
||||
inline SearchType getSearchType() const { return mSearchType; }
|
||||
bool getSavedNewMedia()
|
||||
{ return (mMDResolveHandle ? mMDResolveHandle->getSavedNewMedia() : false); };
|
||||
static bool saveMetadata(const ScraperSearchResult& result,
|
||||
MetaDataList& metadata, FileData* scrapedGame);
|
||||
|
||||
|
|
|
@ -179,6 +179,7 @@ public:
|
|||
void update() override;
|
||||
inline const ScraperSearchResult& getResult() const
|
||||
{ assert(mStatus == ASYNC_DONE); return mResult; }
|
||||
bool getSavedNewMedia() { return mResult.savedNewMedia; }
|
||||
|
||||
private:
|
||||
ScraperSearchResult mResult;
|
||||
|
|
Loading…
Reference in a new issue