From c9201430ea56394291317264982497d19745023d Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Sun, 4 Jun 2023 00:58:35 +0200 Subject: [PATCH] Logging index in transfer. --- src/tools/transfer.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tools/transfer.js b/src/tools/transfer.js index 84d318f4..24528091 100644 --- a/src/tools/transfer.js +++ b/src/tools/transfer.js @@ -612,20 +612,20 @@ async function load() { const tagIdsBySlug = Object.fromEntries(tags.map((tag) => [tag.slug, tag.id])); const studioIdsBySlug = Object.fromEntries(studios.map((studio) => [studio.slug, studio.id])); - const addedMovies = await releases.filter((release) => release.type === 'movie').reduce(async (chain, release) => { + const addedMovies = await releases.filter((release) => release.type === 'movie').reduce(async (chain, release, index, array) => { const acc = await chain; const movie = await addRelease(release, { batchId, tagIdsBySlug, studioIdsBySlug }); - console.log(`Loaded '${movie.entityName}' movie "${movie.title}"`); + console.log(`Loaded ${index}/${array} '${movie.entityName}' movie "${movie.title}"`); return acc.concat(movie); }, Promise.resolve([])); - const addedScenes = await releases.filter((release) => release.type === 'release').reduce(async (chain, release) => { + const addedScenes = await releases.filter((release) => release.type === 'release').reduce(async (chain, release, index, array) => { const acc = await chain; const scene = await addRelease(release, { batchId, movies: addedMovies, tagIdsBySlug, studioIdsBySlug }); - console.log(`Loaded '${scene.entityName}' scene "${scene.title}"`); + console.log(`Loaded ${index}/${array} '${scene.entityName}' scene "${scene.title}"`); return acc.concat(!!scene); }, Promise.resolve([]));