« get me outta code hell

Merge pull request #127 from hsmusic/basic-dynamics - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/listing-spec.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-01-10 17:11:55 -0400
committerGitHub <noreply@github.com>2023-01-10 17:11:55 -0400
commit76f8421b92d8b004bc5c9132abdd9dc78b60a6f5 (patch)
treea9af0c43dd716302789deef7ec9bc7569c236cd0 /src/listing-spec.js
parentccd2235a31c004d099e2d05fb1751a85f58ee97d (diff)
parent1b191f364cf2eed746878ebc86e89ad87ef0189a (diff)
Merge pull request #127 from hsmusic/basic-dynamics
Basic Dynamics (AKA, live reload & data updates)
Diffstat (limited to 'src/listing-spec.js')
-rw-r--r--src/listing-spec.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/listing-spec.js b/src/listing-spec.js
index 636e5f67..1538757c 100644
--- a/src/listing-spec.js
+++ b/src/listing-spec.js
@@ -1,3 +1,5 @@
+import {OFFICIAL_GROUP_DIRECTORY} from './util/magic-constants.js';
+
 import {
   empty,
   accumulateSum,
@@ -876,16 +878,20 @@ const listingSpec = [
     directory: 'random',
     stringsKey: 'other.randomPages',
 
-    data: ({wikiData: {fandomAlbumData, officialAlbumData}}) => [
+    data: ({wikiData: {albumData}}) => [
       {
-        albums: officialAlbumData,
         name: 'Official',
         randomCode: 'official',
+        albums: albumData
+          .filter((album) => album.groups
+            .some((group) => group.directory === OFFICIAL_GROUP_DIRECTORY)),
       },
       {
-        albums: fandomAlbumData,
         name: 'Fandom',
         randomCode: 'fandom',
+        albums: albumData
+          .filter((album) => album.groups
+            .every((group) => group.directory !== OFFICIAL_GROUP_DIRECTORY)),
       },
     ],