« get me outta code hell

support non-jpg album wallpapers & banners - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2022-01-05 15:04:32 -0400
committer(quasar) nebula <qznebula@protonmail.com>2022-01-05 15:04:32 -0400
commitb10d00e4f4cf191ed9cb914052422db4363de349 (patch)
tree6d4f77bb38fb0ae91782f118ff45013726336a17 /src
parente32ca61eb351155524a5ba0c272b26cdc85a8203 (diff)
support non-jpg album wallpapers & banners
Diffstat (limited to 'src')
-rw-r--r--src/misc-templates.js2
-rw-r--r--src/page/album.js2
-rw-r--r--src/page/track.js2
-rwxr-xr-xsrc/upd8.js2
-rw-r--r--src/url-spec.js4
5 files changed, 7 insertions, 5 deletions
diff --git a/src/misc-templates.js b/src/misc-templates.js
index e787184c..578c4e59 100644
--- a/src/misc-templates.js
+++ b/src/misc-templates.js
@@ -184,7 +184,7 @@ export function getAlbumStylesheet(album, {to}) {
     return [
         album.wallpaperArtists && fixWS`
             body::before {
-                background-image: url("${to('media.albumWallpaper', album.directory)}");
+                background-image: url("${to('media.albumWallpaper', album.directory, album.wallpaperFileExtension)}");
                 ${album.wallpaperStyle}
             }
         `,
diff --git a/src/page/album.js b/src/page/album.js
index 19efc701..6e8d6dbc 100644
--- a/src/page/album.js
+++ b/src/page/album.js
@@ -122,7 +122,7 @@ export function write(album, {wikiData}) {
 
                 banner: album.bannerArtists && {
                     dimensions: album.bannerDimensions,
-                    path: ['media.albumBanner', album.directory],
+                    path: ['media.albumBanner', album.directory, album.bannerFileExtension],
                     alt: strings('misc.alt.albumBanner'),
                     position: 'top'
                 },
diff --git a/src/page/track.js b/src/page/track.js
index 0941ee89..c2f2c592 100644
--- a/src/page/track.js
+++ b/src/page/track.js
@@ -155,7 +155,7 @@ export function write(track, {wikiData}) {
                 banner: album.bannerArtists && {
                     classes: ['dim'],
                     dimensions: album.bannerDimensions,
-                    path: ['media.albumBanner', album.directory],
+                    path: ['media.albumBanner', album.directory, album.bannerFileExtension],
                     alt: strings('misc.alt.albumBanner'),
                     position: 'bottom'
                 },
diff --git a/src/upd8.js b/src/upd8.js
index d2e6c3aa..6f538d18 100755
--- a/src/upd8.js
+++ b/src/upd8.js
@@ -789,8 +789,10 @@ async function processAlbumDataFile(file) {
     album.artists = getContributionField(albumSection, 'Artists') || getContributionField(albumSection, 'Artist');
     album.wallpaperArtists = getContributionField(albumSection, 'Wallpaper Art');
     album.wallpaperStyle = getMultilineField(albumSection, 'Wallpaper Style');
+    album.wallpaperFileExtension = getBasicField(albumSection, 'Wallpaper File Extension') || 'jpg';
     album.bannerArtists = getContributionField(albumSection, 'Banner Art');
     album.bannerStyle = getMultilineField(albumSection, 'Banner Style');
+    album.bannerFileExtension = getBasicField(albumSection, 'Banner File Extension') || 'jpg';
     album.bannerDimensions = getDimensionsField(albumSection, 'Banner Dimensions');
     album.date = getBasicField(albumSection, 'Date');
     album.trackArtDate = getBasicField(albumSection, 'Track Art Date') || album.date;
diff --git a/src/url-spec.js b/src/url-spec.js
index d4de616d..3a77858b 100644
--- a/src/url-spec.js
+++ b/src/url-spec.js
@@ -71,8 +71,8 @@ const urlSpec = {
             path: '<>',
 
             albumCover: 'album-art/<>/cover.jpg',
-            albumWallpaper: 'album-art/<>/bg.jpg',
-            albumBanner: 'album-art/<>/banner.jpg',
+            albumWallpaper: 'album-art/<>/bg.<>',
+            albumBanner: 'album-art/<>/banner.<>',
             trackCover: 'album-art/<>/<>.jpg',
             artistAvatar: 'artist-avatar/<>.jpg',
             flashArt: 'flash-art/<>.jpg',