From 6128ba16c1b5c4c6095e0ddba0977817cce4bc6e Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Thu, 27 Apr 2023 16:55:06 -0300 Subject: data: new sortByPositionInFlash act function Fixes #168. This refactors the duplicated logic with sortByPositionInAlbum into a new template, sortByPositionInParent. --- src/misc-templates.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/misc-templates.js') 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 ''; -- cgit 1.3.0-6-gf8a5