« get me outta code hell

normal bug fixes - 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-03 23:32:45 -0400
committer(quasar) nebula <qznebula@protonmail.com>2022-01-03 23:32:45 -0400
commite32ca61eb351155524a5ba0c272b26cdc85a8203 (patch)
tree97d78f0227036e4bd8e58474bf5d7abdf26731db
parent416b7261fa3c9e3d0873fdc9faf501014462e06c (diff)
normal bug fixes
-rwxr-xr-xsrc/upd8.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/upd8.js b/src/upd8.js
index a7058395..d2e6c3aa 100755
--- a/src/upd8.js
+++ b/src/upd8.js
@@ -2724,7 +2724,9 @@ async function main() {
                 if (!contrib.who) {
                     const orig = originalContribStrings.get(contrib);
                     logWarn`Post-process: Contributor ${orig} didn't match any artist data - in ${thing.name} (key: ${key})`;
+                    return false;
                 }
+                return true;
             }));
         }
     };
@@ -2823,6 +2825,10 @@ async function main() {
         }
     }
 
+    // Process contributors before artist data, because a bunch of artist data
+    // will depend on accessing the values postprocessContributors() updates.
+    postprocessContributors();
+
     for (const artist of WD.artistData) {
         const filterProp = (array, prop) => array.filter(thing => thing[prop]?.some(({ who }) => who === artist));
         const filterCommentary = array => array.filter(thing => thing.commentary && thing.commentary.replace(/<\/?b>/g, '').includes('<i>' + artist.name + ':</i>'));
@@ -2849,8 +2855,6 @@ async function main() {
         }
     }
 
-    postprocessContributors();
-
     WD.officialAlbumData = WD.albumData.filter(album => album.groups.some(group => group.directory === OFFICIAL_GROUP_DIRECTORY));
     WD.fandomAlbumData = WD.albumData.filter(album => album.groups.every(group => group.directory !== OFFICIAL_GROUP_DIRECTORY));