Keep original order of custom game lists
authorChristian Weiske <cweiske@cweiske.de>
Wed, 10 Jun 2020 19:03:33 +0000 (21:03 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Wed, 10 Jun 2020 19:03:33 +0000 (21:03 +0200)
bin/filters.php

index 107714d..fc16ef3 100644 (file)
@@ -48,9 +48,11 @@ function filterByPackageNames($origGames, $packageNames)
     $filtered = [];
     foreach ($origGames as $game) {
         if (isset($names[$game->packageName])) {
-            $filtered[] = $game;
+            $filtered[$names[$game->packageName]] = $game;
         }
     }
+    //keep original order
+    ksort($filtered, SORT_NUMERIC);
     return $filtered;
 }