diff options
Diffstat (limited to 'src/content/dependencies/generateAlbumCoverArtwork.js')
-rw-r--r-- | src/content/dependencies/generateAlbumCoverArtwork.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/content/dependencies/generateAlbumCoverArtwork.js b/src/content/dependencies/generateAlbumCoverArtwork.js new file mode 100644 index 00000000..f7e86303 --- /dev/null +++ b/src/content/dependencies/generateAlbumCoverArtwork.js @@ -0,0 +1,23 @@ +export default { + contentDependencies: ['generateCoverArtwork'], + + relations(relation, album) { + return { + coverArtwork: + relation('generateCoverArtwork', album.artTags), + }; + }, + + data(album) { + return { + path: ['media.albumCover', album.directory, album.coverArtFileExtension], + }; + }, + + generate(data, relations) { + return relations.coverArtwork + .slots({ + path: data.path, + }); + }, +}; |