diff options
Diffstat (limited to 'src/content/dependencies')
3 files changed, 22 insertions, 8 deletions
diff --git a/src/content/dependencies/generateAlbumGalleryNoTrackArtworksLine.js b/src/content/dependencies/generateAlbumGalleryNoTrackArtworksLine.js new file mode 100644 index 00000000..ad99cb87 --- /dev/null +++ b/src/content/dependencies/generateAlbumGalleryNoTrackArtworksLine.js @@ -0,0 +1,7 @@ +export default { + extraDependencies: ['html', 'language'], + + generate: ({html, language}) => + html.tag('p', {class: 'quick-info'}, + language.$('albumGalleryPage.noTrackArtworksLine')), +}; diff --git a/src/content/dependencies/generateAlbumGalleryPage.js b/src/content/dependencies/generateAlbumGalleryPage.js index b98abc46..9551eb98 100644 --- a/src/content/dependencies/generateAlbumGalleryPage.js +++ b/src/content/dependencies/generateAlbumGalleryPage.js @@ -3,6 +3,7 @@ import {compareArrays, stitchArrays} from '#sugar'; export default { contentDependencies: [ 'generateAlbumGalleryCoverArtistsLine', + 'generateAlbumGalleryNoTrackArtworksLine', 'generateAlbumGalleryStatsLine', 'generateAlbumNavAccent', 'generateAlbumStyleRules', @@ -62,6 +63,11 @@ export default { relations.statsLine = relation('generateAlbumGalleryStatsLine', album); + if (album.tracks.every(track => !track.hasUniqueCoverArt)) { + relations.noTrackArtworksLine = + relation('generateAlbumGalleryNoTrackArtworksLine'); + } + if (query.coverArtistsForAllTracks) { relations.coverArtistsLine = relation('generateAlbumGalleryCoverArtistsLine', query.coverArtistsForAllTracks); @@ -131,6 +137,7 @@ export default { mainContent: [ relations.statsLine, relations.coverArtistsLine, + relations.noTrackArtworksLine, relations.coverGrid .slots({ diff --git a/src/content/dependencies/generateAlbumNavAccent.js b/src/content/dependencies/generateAlbumNavAccent.js index c79219bb..7eb1dac0 100644 --- a/src/content/dependencies/generateAlbumNavAccent.js +++ b/src/content/dependencies/generateAlbumNavAccent.js @@ -33,10 +33,8 @@ export default { } } - if (album.tracks.some(t => t.hasUniqueCoverArt)) { - relations.albumGalleryLink = - relation('linkAlbumGallery', album); - } + relations.albumGalleryLink = + relation('linkAlbumGallery', album); if (album.commentary || album.tracks.some(t => t.commentary)) { relations.albumCommentaryLink = @@ -49,6 +47,7 @@ export default { data(album, track) { return { hasMultipleTracks: album.tracks.length > 1, + galleryIsStub: album.tracks.every(t => !t.hasUniqueCoverArt), isTrackPage: !!track, }; }, @@ -66,10 +65,11 @@ export default { const {content: extraLinks = []} = slots.showExtraLinks && {content: [ - relations.albumGalleryLink?.slots({ - attributes: {class: slots.currentExtra === 'gallery' && 'current'}, - content: language.$('albumPage.nav.gallery'), - }), + (!data.galleryIsStub || slots.currentExtra === 'gallery') && + relations.albumGalleryLink?.slots({ + attributes: {class: slots.currentExtra === 'gallery' && 'current'}, + content: language.$('albumPage.nav.gallery'), + }), relations.albumCommentaryLink?.slots({ attributes: {class: slots.currentExtra === 'commentary' && 'current'}, |