From df28513bb0c3d54a7bd699cd595732117e7e25d4 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Fri, 12 Mar 2021 20:06:50 +0100 Subject: [PATCH] Fixed multiple issues where the gamelists would not switch view styles after scraping. --- es-app/src/CollectionSystemsManager.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/es-app/src/CollectionSystemsManager.cpp b/es-app/src/CollectionSystemsManager.cpp index 9c835ee64..ebb5534cc 100644 --- a/es-app/src/CollectionSystemsManager.cpp +++ b/es-app/src/CollectionSystemsManager.cpp @@ -365,6 +365,13 @@ void CollectionSystemsManager::updateCollectionSystem(FileData* file, Collection ViewController::get()-> getGameListView(curSys).get()->remove(collectionEntry, false); } + else if (name == "recent" && file->metadata.get("lastplayed") == "0") { + // If lastplayed is set to 0 it means the entry has been cleared, and the + // game should therefore be removed. + ViewController::get()-> + getGameListView(curSys).get()->remove(collectionEntry, false); + ViewController::get()->onFileChanged(rootFolder, true); + } else if (curSys->isCollection() && !file->getCountAsGame()) { // If the countasgame flag has been set to false, then remove the game. if (curSys->isGroupedCustomCollection()) { @@ -382,11 +389,10 @@ void CollectionSystemsManager::updateCollectionSystem(FileData* file, Collection rootFolder->sort(rootFolder->getSortTypeFromString( rootFolder->getSortTypeString()), mFavoritesSorting); } - else { // Re-index with new metadata. fileIndex->addToIndex(collectionEntry); - ViewController::get()->onFileChanged(collectionEntry, false); + ViewController::get()->onFileChanged(collectionEntry, true); } } else { @@ -455,12 +461,12 @@ void CollectionSystemsManager::updateCollectionSystem(FileData* file, Collection } } else { - ViewController::get()->onFileChanged(rootFolder, false); + ViewController::get()->onFileChanged(rootFolder, true); // For custom collections, update either the actual system or its parent depending // on whether the collection is grouped or not. if (sysData.decl.isCustom) { if (rootFolder->getSystem()->isGroupedCustomCollection()) - ViewController::get()->onFileChanged(rootFolder->getParent(), false); + ViewController::get()->onFileChanged(rootFolder->getParent(), true); else ViewController::get()->onFileChanged(rootFolder, false); }