« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/common.js
diff options
context:
space:
mode:
Diffstat (limited to 'common.js')
-rw-r--r--common.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/common.js b/common.js
index b4bf934b..208e33b6 100644
--- a/common.js
+++ b/common.js
@@ -46,6 +46,11 @@ const C = {
         return data.sort((a, b) => a.date - b.date);
     },
 
+    // Same details as the sortByDate, 8ut for covers~
+    sortByArtDate: data => {
+        return data.sort((a, b) => (a.artDate || a.date) - (b.artDate || b.date));
+    },
+
     // This gets all the track o8jects defined in every al8um, and sorts them 8y
     // date released. Generally, albumData will pro8a8ly already 8e sorted 8efore
     // you pass it to this function, 8ut individual tracks can have their own