« get me outta code hell

support albums without cover art - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/page
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2022-05-05 19:33:01 -0300
committer(quasar) nebula <qznebula@protonmail.com>2022-05-05 19:33:01 -0300
commit8fd50d6f0ba8dcfcfe34eb1321dc0bdd307b8c6a (patch)
treeb7bed8c523dcdfaa4eec7c89e311457400530807 /src/page
parente943484cf46cfe509b8d68fada06a760ae05545f (diff)
support albums without cover art
Diffstat (limited to 'src/page')
-rw-r--r--src/page/album.js6
-rw-r--r--src/page/track.js5
2 files changed, 7 insertions, 4 deletions
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
                         })}