Fixing first favorites not updating index

This commit is contained in:
pjft 2018-01-20 21:26:21 +00:00
parent 5f062ff9bc
commit ae1e9e31c7

View file

@ -491,6 +491,7 @@ bool CollectionSystemManager::toggleGameInCollection(FileData* file)
} }
else else
{ {
file->getSourceFileData()->getSystem()->getIndex()->removeFromIndex(file);
MetaDataList* md = &file->getSourceFileData()->metadata; MetaDataList* md = &file->getSourceFileData()->metadata;
std::string value = md->get("favorite"); std::string value = md->get("favorite");
if (value == "false") if (value == "false")
@ -502,6 +503,7 @@ bool CollectionSystemManager::toggleGameInCollection(FileData* file)
adding = false; adding = false;
md->set("favorite", "false"); md->set("favorite", "false");
} }
file->getSourceFileData()->getSystem()->getIndex()->addToIndex(file);
refreshCollectionSystems(file->getSourceFileData()); refreshCollectionSystems(file->getSourceFileData());
} }
if (adding) if (adding)