« get me outta code hell

data: new sortByPositionInFlash act function - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/misc-templates.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-04-27 16:55:06 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-04-27 16:56:00 -0300
commit6128ba16c1b5c4c6095e0ddba0977817cce4bc6e (patch)
tree2f22c42534fdfb4e8dfdd3bb1108dd7eaeaeca23 /src/misc-templates.js
parent3a322d96666b8da2b615ffd1c245f3a2f3d0cd90 (diff)
data: new sortByPositionInFlash act function
Fixes #168.

This refactors the duplicated logic with sortByPositionInAlbum
into a new template, sortByPositionInParent.
Diffstat (limited to 'src/misc-templates.js')
-rw-r--r--src/misc-templates.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/misc-templates.js b/src/misc-templates.js
index 39f597eb..8f3f0166 100644
--- a/src/misc-templates.js
+++ b/src/misc-templates.js
@@ -16,6 +16,7 @@ import {
   getTotalDuration,
   sortAlbumsTracksChronologically,
   sortChronologically,
+  sortFlashesChronologically,
 } from './util/wiki-data.js';
 
 const BANDCAMP_DOMAINS = ['bc.s3m.us', 'music.solatrux.com'];
@@ -165,6 +166,8 @@ function unbound_generateChronologyLinks(currentThing, {
       const things = (
         thingsUnsorted.every(t => t instanceof T.Album || t instanceof T.Track)
           ? sortAlbumsTracksChronologically(...args)
+      : thingsUnsorted.every(t => t instanceof T.Flash)
+          ? sortFlashesChronologically(...args)
           : sortChronologically(...args));
 
       if (things.length === 0) return '';