From b92ae8f64526246142dce51a5af441cbd6319e21 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Wed, 13 Apr 2022 13:08:39 -0300 Subject: fix bugs from using old dateAdded property --- src/listing-spec.js | 6 +++--- src/util/wiki-data.js | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') 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); -- cgit 1.3.0-6-gf8a5