diff options
Diffstat (limited to 'src/content/dependencies/generateWikiHomepageAlbumCarouselRow.js')
| -rw-r--r-- | src/content/dependencies/generateWikiHomepageAlbumCarouselRow.js | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/src/content/dependencies/generateWikiHomepageAlbumCarouselRow.js b/src/content/dependencies/generateWikiHomepageAlbumCarouselRow.js index 3068d951..8f4b3400 100644 --- a/src/content/dependencies/generateWikiHomepageAlbumCarouselRow.js +++ b/src/content/dependencies/generateWikiHomepageAlbumCarouselRow.js @@ -1,8 +1,4 @@ -import {stitchArrays} from '#sugar'; - export default { - contentDependencies: ['generateCoverCarousel', 'image', 'linkAlbum'], - relations: (relation, row) => ({ coverCarousel: relation('generateCoverCarousel'), @@ -13,27 +9,12 @@ export default { images: row.albums - .map(album => relation('image', album.artTags)), + .map(album => relation('image', album.coverArtworks[0])), }), - data: (row) => ({ - paths: - row.albums.map(album => - (album.hasCoverArt - ? ['media.albumCover', album.directory, album.coverArtFileExtension] - : null)), - }), - - generate: (data, relations) => + generate: (relations) => relations.coverCarousel.slots({ - links: - relations.links, - - images: - stitchArrays({ - image: relations.images, - path: data.paths, - }).map(({image, path}) => - image.slot('path', path)), + links: relations.links, + images: relations.images, }), }; |