migrate groups in priority of moderator, then pinned status

This commit is contained in:
rootdarkarchon
2023-01-30 12:25:39 +01:00
parent edb04c8d9d
commit cdba293aa1

View File

@@ -67,7 +67,7 @@ public static class SharedDbFunctions
{ {
bool groupHasMigrated = false; bool groupHasMigrated = false;
string newOwner = string.Empty; string newOwner = string.Empty;
foreach (var potentialNewOwner in groupPairs) foreach (var potentialNewOwner in groupPairs.OrderByDescending(p => p.IsModerator).ThenByDescending(p => p.IsPinned).ToList())
{ {
groupHasMigrated = await TryMigrateGroup(context, group, potentialNewOwner.GroupUserUID, maxGroupsByUser).ConfigureAwait(false); groupHasMigrated = await TryMigrateGroup(context, group, potentialNewOwner.GroupUserUID, maxGroupsByUser).ConfigureAwait(false);