« get me outta code hell

thumbs, infra: expose list of missing image paths - 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>2023-09-11 15:09:19 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-09-11 15:09:19 -0300
commitb19e165dc8ba13cd0e2d1862e645d34d86142566 (patch)
treea7f0a9fbf8e75942bb9e963a587f533072f886e5 /src
parent78115f0be17ee405d3711204aaa53e0597a29826 (diff)
thumbs, infra: expose list of missing image paths
Diffstat (limited to 'src')
-rw-r--r--src/gen-thumbs.js2
-rwxr-xr-xsrc/upd8.js4
-rw-r--r--src/write/bind-utilities.js2
-rw-r--r--src/write/build-modes/live-dev-server.js2
-rw-r--r--src/write/build-modes/static-build.js2
5 files changed, 11 insertions, 1 deletions
diff --git a/src/gen-thumbs.js b/src/gen-thumbs.js
index a5b550ad..b7c192c3 100644
--- a/src/gen-thumbs.js
+++ b/src/gen-thumbs.js
@@ -689,6 +689,8 @@ export async function verifyImagePaths(mediaPath, {urls, wikiData}) {
       console.warn(color.yellow(` - `) + file);
     }
   }
+
+  return {missing, misplaced};
 }
 
 // Recursively traverses the provided (extant) media path, filtering so only
diff --git a/src/upd8.js b/src/upd8.js
index 2ec231c9..b3646c9d 100755
--- a/src/upd8.js
+++ b/src/upd8.js
@@ -677,7 +677,8 @@ async function main() {
 
   const urls = generateURLs(urlSpec);
 
-  await verifyImagePaths(mediaPath, {urls, wikiData});
+  const {missing: missingImagePaths} =
+    await verifyImagePaths(mediaPath, {urls, wikiData});
 
   const fileSizePreloader = new FileSizePreloader();
 
@@ -795,6 +796,7 @@ async function main() {
 
     defaultLanguage: finalDefaultLanguage,
     languages,
+    missingImagePaths,
     thumbsCache,
     urls,
     urlSpec,
diff --git a/src/write/bind-utilities.js b/src/write/bind-utilities.js
index 942cce89..3d4ecc7a 100644
--- a/src/write/bind-utilities.js
+++ b/src/write/bind-utilities.js
@@ -25,6 +25,7 @@ export function bindUtilities({
   getSizeOfImagePath,
   language,
   languages,
+  missingImagePaths,
   pagePath,
   thumbsCache,
   to,
@@ -43,6 +44,7 @@ export function bindUtilities({
     html,
     language,
     languages,
+    missingImagePaths,
     pagePath,
     thumb,
     to,
diff --git a/src/write/build-modes/live-dev-server.js b/src/write/build-modes/live-dev-server.js
index 9889b3f0..730686db 100644
--- a/src/write/build-modes/live-dev-server.js
+++ b/src/write/build-modes/live-dev-server.js
@@ -58,6 +58,7 @@ export async function go({
 
   defaultLanguage,
   languages,
+  missingImagePaths,
   srcRootPath,
   thumbsCache,
   urls,
@@ -347,6 +348,7 @@ export async function go({
         getSizeOfImagePath,
         language,
         languages,
+        missingImagePaths,
         pagePath: servePath,
         thumbsCache,
         to,
diff --git a/src/write/build-modes/static-build.js b/src/write/build-modes/static-build.js
index 82a947c7..79c8defd 100644
--- a/src/write/build-modes/static-build.js
+++ b/src/write/build-modes/static-build.js
@@ -90,6 +90,7 @@ export async function go({
 
   defaultLanguage,
   languages,
+  missingImagePaths,
   srcRootPath,
   thumbsCache,
   urls,
@@ -302,6 +303,7 @@ export async function go({
           getSizeOfImagePath,
           language,
           languages,
+          missingImagePaths,
           pagePath,
           thumbsCache,
           to,