Fixed an issue where custom collections could get the wrong sort order after metadata changes.

This commit is contained in:
Leon Styhre 2022-01-14 17:27:42 +01:00
parent c38b5bd2d3
commit cd2ef3d179

View file

@ -419,12 +419,14 @@ void CollectionSystemsManager::updateCollectionSystem(FileData* file, Collection
// If the game doesn't exist in the current system and it's a custom
// collection, then skip the sorting.
else if (sysData.decl.isCustom && children.find(file->getFullPath()) != children.cend()) {
// For custom collections, update either the actual system or its parent depending
// on whether the collection is grouped or not.
// For custom collections, depending on whether the collection is grouped or not,
// update either only the actual system or both the actual system and its parent.
if (rootFolder->getSystem()->isGroupedCustomCollection()) {
rootFolder->getParent()->sort(rootFolder->getParent()->getSortTypeFromString(
rootFolder->getParent()->getSortTypeString()),
mFavoritesSorting);
rootFolder->sort(rootFolder->getSortTypeFromString(rootFolder->getSortTypeString()),
mFavoritesSorting);
}
else {
rootFolder->sort(rootFolder->getSortTypeFromString(rootFolder->getSortTypeString()),