diff --git a/src/client/actions/fileops.actions.tsx b/src/client/actions/fileops.actions.tsx index 8d7112f..2eab146 100644 --- a/src/client/actions/fileops.actions.tsx +++ b/src/client/actions/fileops.actions.tsx @@ -1,9 +1,9 @@ import axios from "axios"; -import { IFolderData } from "../shared/interfaces/comicinfo.interfaces"; import { IExtractComicBookCoverErrorResponse, IExtractedComicBookCoverFile, IExtractionOptions, + IFolderData, } from "../../server/interfaces/folder.interface"; import { FS_API_BASE_URI } from "../constants/endpoints"; @@ -25,6 +25,7 @@ export async function walkFolder(path: string): Promise> { export async function extractCoverFromComicBookArchive( options: IExtractionOptions, + walkedFolders: Array, ): Promise< | IExtractedComicBookCoverFile | IExtractedComicBookCoverFile[] @@ -34,7 +35,8 @@ export async function extractCoverFromComicBookArchive( url: FS_API_BASE_URI + "getComicCovers", method: "POST", data: { - ...options, + options, + walkedFolders, }, }); } diff --git a/src/client/workers/extractCovers.worker.ts b/src/client/workers/extractCovers.worker.ts index 2b0a58b..e1af6e5 100644 --- a/src/client/workers/extractCovers.worker.ts +++ b/src/client/workers/extractCovers.worker.ts @@ -2,9 +2,7 @@ import { walkFolder, extractCoverFromComicBookArchive, } from "../actions/fileops.actions"; -import { SUPPORTED_COMIC_ARCHIVES } from "../constants/importer.config"; import { IExtractedComicBookCoverFile } from "../../server/interfaces/folder.interface"; -import _ from "lodash"; export const greet = async ( path: string, @@ -13,6 +11,7 @@ export const greet = async ( sourceFolder: path, extractTarget: "all", targetExtractionFolder: "./userdata/expanded", + extractionMode: "bulk", }; const pagingConfig = { @@ -21,14 +20,11 @@ export const greet = async ( }; const fileObjects = await walkFolder("./comics"); -{ - if (SUPPORTED_COMIC_ARCHIVES.includes(fileObject.extension)) { - return await extractCoverFromComicBookArchive({ - ...targetOptions, - paginationOptions: pagingConfig, - folderDetails: fileObject, - }); - } - }); - + return await extractCoverFromComicBookArchive( + { + ...targetOptions, + paginationOptions: pagingConfig, + }, + fileObjects, + ); };