« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/upd8.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/upd8.js')
-rwxr-xr-xsrc/upd8.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/upd8.js b/src/upd8.js
index 26572aa7..29063f87 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');