From 8aa09fe9f5362074098bf55e4472437e5cb81680 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Fri, 4 Aug 2023 17:51:02 +0200 Subject: [PATCH] Fixed an issue where the thumbnail image would not get downloaded for all entries in the interactive scraper if they shared the same URL --- es-app/src/guis/GuiScraperSearch.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/es-app/src/guis/GuiScraperSearch.cpp b/es-app/src/guis/GuiScraperSearch.cpp index 9e362b30e..e9c26d18f 100644 --- a/es-app/src/guis/GuiScraperSearch.cpp +++ b/es-app/src/guis/GuiScraperSearch.cpp @@ -624,9 +624,10 @@ void GuiScraperSearch::updateInfoPane() mScraperResults[i].thumbnailDownloadStatus = IN_PROGRESS; // Add an entry into the thumbnail map, this way we can track and download // each thumbnail separately even as they're downloading while scrolling - // through the result list. + // through the result list. Add the row number as an index in case the same + // thumbnail is used by more than one game. mThumbnailReqMap.insert(std::pair>( - mScraperResults[i].thumbnailImageUrl, + mScraperResults[i].thumbnailImageUrl + "." + std::to_string(i), std::unique_ptr(new HttpReq(thumb, true)))); } } @@ -785,7 +786,8 @@ void GuiScraperSearch::update(int deltaTime) // Check if the thumbnail for the currently selected game has finished downloading. if (mScraperResults.size() > 0) { auto it = - mThumbnailReqMap.find(mScraperResults[mResultList->getCursorId()].thumbnailImageUrl); + mThumbnailReqMap.find(mScraperResults[mResultList->getCursorId()].thumbnailImageUrl + + "." + std::to_string(mResultList->getCursorId())); if (it != mThumbnailReqMap.end() && it->second->status() != HttpReq::REQ_IN_PROGRESS) updateThumbnail(); } @@ -917,7 +919,8 @@ void GuiScraperSearch::update(int deltaTime) void GuiScraperSearch::updateThumbnail() { - auto it = mThumbnailReqMap.find(mScraperResults[mResultList->getCursorId()].thumbnailImageUrl); + auto it = mThumbnailReqMap.find(mScraperResults[mResultList->getCursorId()].thumbnailImageUrl + + "." + std::to_string(mResultList->getCursorId())); if (it != mThumbnailReqMap.end() && it->second->status() == HttpReq::REQ_SUCCESS) { // Save thumbnail to mScraperResults cache and set the flag that the