do not show "Make" apps in discover
[stouyapi.git] / bin / filters.php
index 07a00bb3a778482e09b1a72f3acf5db6635d19b1..703114a2410fa9e65f88aec8d3c2e499379fa9a8 100644 (file)
@@ -10,12 +10,18 @@ function filterByAge($origGames, $age)
     return $filtered;
 }
 
-function filterByGenre($origGames, $genre)
+function filterByGenre($origGames, $genre, $remove = false)
 {
     $filtered = [];
     foreach ($origGames as $game) {
-        if (array_search($genre, $game->genres) !== false) {
-            $filtered[] = $game;
+        if ($remove) {
+            if (array_search($genre, $game->genres) === false) {
+                $filtered[] = $game;
+            }
+        } else {
+            if (array_search($genre, $game->genres) !== false) {
+                $filtered[] = $game;
+            }
         }
     }
     return $filtered;