From 2d5e22df4b418d96a88afb4589ac326fb77b6e7a Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Wed, 26 Jul 2023 11:23:49 -0300 Subject: content: generateWikiHomeAlbumsRow + homepage content --- src/util/wiki-data.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/util') diff --git a/src/util/wiki-data.js b/src/util/wiki-data.js index a3133748..97a3f3e5 100644 --- a/src/util/wiki-data.js +++ b/src/util/wiki-data.js @@ -728,8 +728,8 @@ export function getArtistAvatar(artist, {to}) { // Big-ass homepage row functions -export function getNewAdditions(numAlbums, {wikiData}) { - const sortedAlbums = wikiData.albumData +export function getNewAdditions(numAlbums, {albumData}) { + const sortedAlbums = albumData .filter((album) => album.isListedOnHomepage) .sort((a, b) => { if (a.dateAddedToWiki > b.dateAddedToWiki) return -1; @@ -808,15 +808,14 @@ export function getNewAdditions(numAlbums, {wikiData}) { } } - return albums.map((album) => ({item: album})); + return albums; } -export function getNewReleases(numReleases, {wikiData}) { - return wikiData.albumData +export function getNewReleases(numReleases, {albumData}) { + return albumData .filter((album) => album.isListedOnHomepage) .reverse() - .slice(0, numReleases) - .map((album) => ({item: album})); + .slice(0, numReleases); } // Carousel layout and utilities -- cgit 1.3.0-6-gf8a5