« get me outta code hell

fix bugs from using old dateAdded property - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2022-04-13 13:08:39 -0300
committer(quasar) nebula <qznebula@protonmail.com>2022-04-13 13:08:39 -0300
commitb92ae8f64526246142dce51a5af441cbd6319e21 (patch)
treeb8f21d903f9ada227731cd54dd5470d6880aa99d /src
parente8d048b093021630b71b38095b1375d464a93571 (diff)
fix bugs from using old dateAdded property
Diffstat (limited to 'src')
-rw-r--r--src/listing-spec.js6
-rw-r--r--src/util/wiki-data.js8
2 files changed, 7 insertions, 7 deletions
diff --git a/src/listing-spec.js b/src/listing-spec.js
index 97c1ef4a..334ea7f4 100644
--- a/src/listing-spec.js
+++ b/src/listing-spec.js
@@ -88,9 +88,9 @@ const listingSpec = [
 
         data({wikiData}) {
             return chunkByProperties(wikiData.albumData.slice().sort((a, b) => {
-                if (a.dateAdded < b.dateAdded) return -1;
-                if (a.dateAdded > b.dateAdded) return 1;
-            }), ['dateAdded']);
+                if (a.dateAddedToWiki < b.dateAddedToWiki) return -1;
+                if (a.dateAddedToWiki > b.dateAddedToWiki) return 1;
+            }), ['dateAddedToWiki']);
         },
 
         html(chunks, {link, strings}) {
diff --git a/src/util/wiki-data.js b/src/util/wiki-data.js
index 76018313..545e21e5 100644
--- a/src/util/wiki-data.js
+++ b/src/util/wiki-data.js
@@ -183,8 +183,8 @@ export function getNewAdditions(numAlbums, {wikiData}) {
     // are usually at the start of the final output for a given d8 of release
     // too).
     const sortedAlbums = albumData.filter(album => album.isListedOnHomepage).sort((a, b) => {
-        if (a.dateAdded > b.dateAdded) return -1;
-        if (a.dateAdded < b.dateAdded) return 1;
+        if (a.dateAddedToWiki > b.dateAddedToWiki) return -1;
+        if (a.dateAddedToWiki < b.dateAddedToWiki) return 1;
         if (a.isMajorRelease && !b.isMajorRelease) return -1;
         if (!a.isMajorRelease && b.isMajorRelease) return 1;
         if (a.date > b.date) return -1;
@@ -218,10 +218,10 @@ export function getNewAdditions(numAlbums, {wikiData}) {
         // time we access one of its entries. This is 8asically unnecessary
         // since this will never 8e an expensive enough task for that to
         // matter.... 8ut it's nicer code. BBBB) )
-        const currentDate = sortedAlbums[i].dateAdded;
+        const currentDate = sortedAlbums[i].dateAddedToWiki;
         const groupMap = new Map();
         const groupArray = [];
-        for (let album; (album = sortedAlbums[i]) && +album.dateAdded === +currentDate; i++) {
+        for (let album; (album = sortedAlbums[i]) && +album.dateAddedToWiki === +currentDate; i++) {
             const primaryGroup = album.groups[0];
             if (groupMap.has(primaryGroup)) {
                 groupMap.get(primaryGroup).push(album);