« get me outta code hell

Merge branch 'staging' of notabug.org:hsmusic/hsmusic-wiki into staging - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2022-01-01 22:46:14 -0400
committer(quasar) nebula <qznebula@protonmail.com>2022-01-01 22:46:14 -0400
commit1b4a8e79e94d67444675b43c1a40c161b9d6b3db (patch)
treef730436de16108d6f10aa40849739bbf791852e9
parentfebc48a2d50e5440ee598f594676e1e8aeafbff5 (diff)
parent40d0c09ea64a6e0d3bd93e902a14218a96e95933 (diff)
Merge branch 'staging' of notabug.org:hsmusic/hsmusic-wiki into staging
-rwxr-xr-xsrc/upd8.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/upd8.js b/src/upd8.js
index 26572aa..29063f8 100755
--- a/src/upd8.js
+++ b/src/upd8.js
@@ -782,6 +782,11 @@ async function processAlbumDataFile(file) {
     const album = {};
 
     album.name = getBasicField(albumSection, 'Album');
+
+    if (!album.name) {
+        return {error: `The file "${path.relative(dataPath, file)}" is missing the "Album" field - maybe this is a misplaced file instead of album data?`};
+    }
+
     album.artists = getContributionField(albumSection, 'Artists') || getContributionField(albumSection, 'Artist');
     album.wallpaperArtists = getContributionField(albumSection, 'Wallpaper Art');
     album.wallpaperStyle = getMultilineField(albumSection, 'Wallpaper Style');