« 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/page
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/page
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/page')
-rw-r--r--src/page/artist.js4
-rw-r--r--src/page/track.js4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/page/artist.js b/src/page/artist.js
index 29e4aba6..4ef44d32 100644
--- a/src/page/artist.js
+++ b/src/page/artist.js
@@ -12,7 +12,7 @@ import {
   chunkByProperties,
   getTotalDuration,
   sortAlbumsTracksChronologically,
-  sortChronologically,
+  sortFlashesChronologically,
 } from '../util/wiki-data.js';
 
 export const description = `per-artist info & artwork gallery pages`;
@@ -129,7 +129,7 @@ export function write(artist, {wikiData}) {
 
   let flashes, flashListChunks;
   if (wikiInfo.enableFlashesAndGames) {
-    flashes = sortChronologically(artist.flashesAsContributor.slice());
+    flashes = sortFlashesChronologically(artist.flashesAsContributor.slice());
     flashListChunks = chunkByProperties(
       flashes.map((flash) => ({
         act: flash.act,
diff --git a/src/page/track.js b/src/page/track.js
index 7f0d1cf2..b6b03f35 100644
--- a/src/page/track.js
+++ b/src/page/track.js
@@ -16,7 +16,7 @@ import {
 import {
   getTrackCover,
   getAlbumListTag,
-  sortChronologically,
+  sortFlashesChronologically,
 } from '../util/wiki-data.js';
 
 export const description = `per-track info pages`;
@@ -42,7 +42,7 @@ export function write(track, {wikiData}) {
 
   let flashesThatFeature;
   if (wikiInfo.enableFlashesAndGames) {
-    flashesThatFeature = sortChronologically(
+    flashesThatFeature = sortFlashesChronologically(
       [track, ...otherReleases].flatMap((track) =>
         track.featuredInFlashes.map((flash) => ({
           flash,