« get me outta code hell

data: pre-sort artists, mark group non-sorting - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/things
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-01-29 08:27:40 -0400
committer(quasar) nebula <qznebula@protonmail.com>2024-01-30 07:59:40 -0400
commit4aca33098a53d29082e1e121d841d5eb6fb07126 (patch)
tree8640f932888601c3311249031071d7b06e2a6cbe /src/data/things
parent2960fb60606ce0e356f7cb62c3b17e9d41e742fc (diff)
data: pre-sort artists, mark group non-sorting
Diffstat (limited to 'src/data/things')
-rw-r--r--src/data/things/artist.js6
-rw-r--r--src/data/things/group.js4
2 files changed, 10 insertions, 0 deletions
diff --git a/src/data/things/artist.js b/src/data/things/artist.js
index 8f32afd7..a3766f00 100644
--- a/src/data/things/artist.js
+++ b/src/data/things/artist.js
@@ -5,6 +5,7 @@ import find from '#find';
 import {unique} from '#sugar';
 import Thing from '#thing';
 import {isName, validateArrayItems} from '#validators';
+import {sortAlphabetically} from '#wiki-data';
 
 import {withReverseContributionList} from '#composite/wiki-data';
 
@@ -287,5 +288,10 @@ export class Artist extends Thing {
 
       return {artistData, artistAliasData};
     },
+
+    sort({artistData, artistAliasData}) {
+      sortAlphabetically(artistData);
+      sortAlphabetically(artistAliasData);
+    },
   });
 }
diff --git a/src/data/things/group.js b/src/data/things/group.js
index a32cd64d..462c928a 100644
--- a/src/data/things/group.js
+++ b/src/data/things/group.js
@@ -143,6 +143,10 @@ export class Group extends Thing {
 
       return {groupData, groupCategoryData};
     },
+
+    // Groups aren't sorted at all, always preserving the order in the data
+    // file as-is.
+    sort: null,
   });
 }