From 8fd50d6f0ba8dcfcfe34eb1321dc0bdd307b8c6a Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Thu, 5 May 2022 19:33:01 -0300 Subject: support albums without cover art --- src/page/album.js | 6 ++++-- src/page/track.js | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'src/page') diff --git a/src/page/album.js b/src/page/album.js index 70320b21..eac0a9f3 100644 --- a/src/page/album.js +++ b/src/page/album.js @@ -118,6 +118,8 @@ export function write(album, {wikiData}) { strings }); + const cover = getAlbumCover(album); + return { title: strings('albumPage.title', {album: album.name}), stylesheet: getAlbumStylesheet(album), @@ -134,8 +136,8 @@ export function write(album, {wikiData}) { main: { content: fixWS` - ${generateCoverLink({ - src: getAlbumCover(album), + ${cover && generateCoverLink({ + src: cover, alt: strings('misc.alt.albumCover'), tags: album.artTags })} diff --git a/src/page/track.js b/src/page/track.js index 17e75858..960f00ce 100644 --- a/src/page/track.js +++ b/src/page/track.js @@ -138,6 +138,7 @@ export function write(track, {wikiData}) { to }) => { const generateTrackList = bindOpts(unbound_generateTrackList, {getArtistString, link, strings}); + const cover = getTrackCover(track); return { title: strings('trackPage.title', {track: track.name}), @@ -160,8 +161,8 @@ export function write(track, {wikiData}) { main: { content: fixWS` - ${generateCoverLink({ - src: getTrackCover(track), + ${cover && generateCoverLink({ + src: cover, alt: strings('misc.alt.trackCover'), tags: track.artTags })} -- cgit 1.3.0-6-gf8a5