From 8978169af6529321e2db6193bc5fe193126e8258 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Mon, 30 Oct 2023 17:11:04 -0300 Subject: upd8: add determineMediaCachePath to stepStatusSummary --- src/upd8.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/upd8.js b/src/upd8.js index 869d732..2318277 100755 --- a/src/upd8.js +++ b/src/upd8.js @@ -114,6 +114,9 @@ async function main() { Error.stackTraceLimit = Infinity; stepStatusSummary = { + determineMediaCachePath: + {...defaultStepStatus, name: `determine media cache path`}, + migrateThumbnails: {...defaultStepStatus, name: `migrate thumbnails`}, @@ -485,6 +488,8 @@ async function main() { }); } + stepStatusSummary.determineMediaCachePath.status = STATUS_STARTED_NOT_DONE; + const {mediaCachePath, annotation: mediaCachePathAnnotation} = await determineMediaCachePath({ mediaPath, @@ -496,6 +501,7 @@ async function main() { if (!mediaCachePath) { logError`Couldn't determine a media cache path. (${mediaCachePathAnnotation})`; + switch (mediaCachePathAnnotation) { case 'inferred path does not have cache': logError`If you're certain this is the right path, you can provide it via`; @@ -513,11 +519,22 @@ async function main() { logError`Make sure one of these is actually pointing to a path that exists.`; break; } + + Object.assign(stepStatusSummary.determineMediaCachePath, { + status: STATUS_FATAL_ERROR, + annotation: mediaCachePathAnnotation, + }); + return false; } logInfo`Using media cache at: ${mediaCachePath} (${mediaCachePathAnnotation})`; + Object.assign(stepStatusSummary.determineMediaCachePath, { + status: STATUS_DONE_CLEAN, + annotation: mediaCachePathAnnotation, + }); + if (migrateThumbs) { stepStatusSummary.migrateThumbnails.status = STATUS_STARTED_NOT_DONE; -- cgit 1.3.0-6-gf8a5