🐳 Workerizing
This commit is contained in:
@@ -13,16 +13,17 @@ export const greet = async (
|
||||
const targetOptions = {
|
||||
sourceFolder: path,
|
||||
extractTarget: "cover",
|
||||
targetExtractionFolder: "../covers",
|
||||
targetExtractionFolder: "./userdata/covers",
|
||||
};
|
||||
const fileObjects = await walkFolder("./comics");
|
||||
_.map(fileObjects, async (fileObject) => {
|
||||
console.log(fileObject);
|
||||
if (SUPPORTED_COMIC_ARCHIVES.includes(fileObject.extension)) {
|
||||
await extractCoverFromComicBookArchive({
|
||||
console.log({ ...targetOptions, folderDetails: fileObject });
|
||||
await extractCoverFromComicBookArchive({
|
||||
...targetOptions,
|
||||
folderDetails: fileObject,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -14,6 +14,7 @@ router.route("/getComicCovers").post(async (req: Request, res: Response) => {
|
||||
typeof req.body.extractionOptions === "object"
|
||||
? req.body.extractionOptions
|
||||
: {};
|
||||
console.log(req.body)
|
||||
const extractedData = await extractArchive(req.body.extractionOptions);
|
||||
// const foo = await extractMetadataFromImage(
|
||||
// "./comics/covers/Ghosts and Ruins-001.jpg",
|
||||
|
||||
@@ -172,6 +172,7 @@ export const extractArchive = async (
|
||||
| IExtractedComicBookCoverFile[]
|
||||
| IExtractComicBookCoverErrorResponse
|
||||
> => {
|
||||
console.log(extractionOptions);
|
||||
switch (extractionOptions.folderDetails.extension) {
|
||||
case ".cbz":
|
||||
return await unzip(extractionOptions);
|
||||
|
||||
Reference in New Issue
Block a user