diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2024-11-19 15:56:40 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2024-11-19 16:05:41 -0400 |
commit | c31d38c4778e51fb90958c40af93519661538889 (patch) | |
tree | c9d7b42e9a26657efebb22495424c26b19848a5e /src/content/dependencies/generateTrackCoverArtwork.js | |
parent | d746ff26c3e7517c8aaff7615ae4da06fa2d01c0 (diff) |
content, css: cover artwork reference details, non-unique art line
Diffstat (limited to 'src/content/dependencies/generateTrackCoverArtwork.js')
-rw-r--r-- | src/content/dependencies/generateTrackCoverArtwork.js | 67 |
1 files changed, 60 insertions, 7 deletions
diff --git a/src/content/dependencies/generateTrackCoverArtwork.js b/src/content/dependencies/generateTrackCoverArtwork.js index 2ad14993..90ce2b4a 100644 --- a/src/content/dependencies/generateTrackCoverArtwork.js +++ b/src/content/dependencies/generateTrackCoverArtwork.js @@ -3,7 +3,11 @@ export default { 'generateCoverArtwork', 'generateCoverArtworkArtTagDetails', 'generateCoverArtworkArtistDetails', + 'generateCoverArtworkReferenceDetails', 'image', + 'linkAlbum', + 'linkTrackReferencedArtworks', + 'linkTrackReferencingArtworks', ], extraDependencies: ['html', 'language'], @@ -26,6 +30,20 @@ export default { (track.hasUniqueCoverArt ? track.coverArtistContribs : track.album.coverArtistContribs)), + + referenceDetails: + relation('generateCoverArtworkReferenceDetails', + track.referencedArtworks, + track.referencedByArtworks), + + referencedArtworksLink: + relation('linkTrackReferencedArtworks', track), + + referencingArtworksLink: + relation('linkTrackReferencingArtworks', track), + + albumLink: + relation('linkAlbum', track.album), }), data: (track) => ({ @@ -41,6 +59,9 @@ export default { (track.hasUniqueCoverArt ? track.coverArtDimensions : track.album.coverArtDimensions), + + nonUnique: + !track.hasUniqueCoverArt, }), slots: { @@ -50,9 +71,19 @@ export default { validate: v => v.is('tags', 'artists'), default: 'tags', }, + + showReferenceLinks: { + type: 'boolean', + default: false, + }, + + showNonUniqueLine: { + type: 'boolean', + default: false, + }, }, - generate: (data, relations, slots, {language}) => + generate: (data, relations, slots, {html, language}) => relations.coverArtwork.slots({ mode: slots.mode, @@ -65,12 +96,34 @@ export default { dimensions: data.dimensions, - details: - (slots.details === 'tags' - ? relations.artTagDetails - : slots.details === 'artists' - ? relations.artistDetails - : null), + details: [ + slots.details === 'tags' && + relations.artTagDetails, + + slots.details === 'artists'&& + relations.artistDetails, + + slots.showReferenceLinks && + relations.referenceDetails.slots({ + referencedLink: + relations.referencedArtworksLink, + + referencingLink: + relations.referencingArtworksLink, + }), + + slots.showNonUniqueLine && + data.nonUnique && + html.tag('p', {class: 'image-details'}, + {class: 'non-unique-details'}, + + language.$('misc.trackArtFromAlbum', { + album: + relations.albumLink.slots({ + color: false, + }), + })), + ], }), }; |