« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/yaml.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/data/yaml.js')
-rw-r--r--src/data/yaml.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/data/yaml.js b/src/data/yaml.js
index 32cf7292..763dfd28 100644
--- a/src/data/yaml.js
+++ b/src/data/yaml.js
@@ -42,8 +42,9 @@ import {
 } from '../util/sugar.js';
 
 import {
-    sortByDate,
-    sortByName,
+    sortAlbumsTracksChronologically,
+    sortAlphabetically,
+    sortChronologically,
 } from '../util/wiki-data.js';
 
 import find, { bindFind } from '../util/find.js';
@@ -861,7 +862,7 @@ export const dataSteps = [
         processDocument: processNewsEntryDocument,
 
         save(newsData) {
-            sortByDate(newsData);
+            sortChronologically(newsData);
             newsData.reverse();
 
             return {newsData};
@@ -876,7 +877,7 @@ export const dataSteps = [
         processDocument: processArtTagDocument,
 
         save(artTagData) {
-            artTagData.sort(sortByName);
+            sortAlphabetically(artTagData);
 
             return {artTagData};
         }
@@ -1108,8 +1109,8 @@ export function linkWikiDataArrays(wikiData) {
 
 export function sortWikiDataArrays(wikiData) {
     Object.assign(wikiData, {
-        albumData: sortByDate(wikiData.albumData.slice()),
-        trackData: sortByDate(wikiData.trackData.slice())
+        albumData: sortChronologically(wikiData.albumData.slice()),
+        trackData: sortAlbumsTracksChronologically(wikiData.trackData.slice()),
     });
 
     // Re-link data arrays, so that every object has the new, sorted versions.