« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/data/yaml.js1
-rw-r--r--src/util/wiki-data.js15
2 files changed, 3 insertions, 13 deletions
diff --git a/src/data/yaml.js b/src/data/yaml.js
index 0ecc1f1e..a2811d43 100644
--- a/src/data/yaml.js
+++ b/src/data/yaml.js
@@ -1391,6 +1391,7 @@ export function filterDuplicateDirectories(wikiData) {
     'albumData',
     'artTagData',
     'flashData',
+    'flashActData',
     'groupData',
     'newsData',
     'trackData',
diff --git a/src/util/wiki-data.js b/src/util/wiki-data.js
index ac652b27..0790ae91 100644
--- a/src/util/wiki-data.js
+++ b/src/util/wiki-data.js
@@ -610,20 +610,9 @@ export function sortFlashesChronologically(data, {
   latestFirst = false,
   getDate,
 } = {}) {
-  // Flash acts don't actually have any identifying properties because they
-  // don't have dedicated pages (yet), so don't have a directory. Make up a
-  // fake key identifying them so flashes can be grouped together.
-  const flashActs = new Set(data.map(flash => flash.act));
-  const flashActIdentifiers = new Map();
-
-  let counter = 0;
-  for (const act of flashActs) {
-    flashActIdentifiers.set(act, ++counter);
-  }
-
   // Group flashes by act...
-  data.sort((a, b) => {
-    return flashActIdentifiers.get(a.act) - flashActIdentifiers.get(b.act);
+  sortByDirectory(data, {
+    getDirectory: flash => flash.act.directory,
   });
 
   // Sort flashes by position in act...