🐛 bugs
This commit is contained in:
@@ -17,7 +17,6 @@ export const greet = async (
|
|||||||
};
|
};
|
||||||
const fileObjects = await walkFolder("./comics");
|
const fileObjects = await walkFolder("./comics");
|
||||||
_.map(fileObjects, async (fileObject) => {
|
_.map(fileObjects, async (fileObject) => {
|
||||||
console.log(fileObject);
|
|
||||||
if (SUPPORTED_COMIC_ARCHIVES.includes(fileObject.extension)) {
|
if (SUPPORTED_COMIC_ARCHIVES.includes(fileObject.extension)) {
|
||||||
console.log({ ...targetOptions, folderDetails: fileObject });
|
console.log({ ...targetOptions, folderDetails: fileObject });
|
||||||
await extractCoverFromComicBookArchive({
|
await extractCoverFromComicBookArchive({
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ router.route("/getComicCovers").post(async (req: Request, res: Response) => {
|
|||||||
typeof req.body.extractionOptions === "object"
|
typeof req.body.extractionOptions === "object"
|
||||||
? req.body.extractionOptions
|
? req.body.extractionOptions
|
||||||
: {};
|
: {};
|
||||||
console.log(req.body)
|
console.log("ASDASDASDASDASD", req.body)
|
||||||
const extractedData = await extractArchive(req.body.extractionOptions);
|
const extractedData = await extractArchive(req.body);
|
||||||
// const foo = await extractMetadataFromImage(
|
// const foo = await extractMetadataFromImage(
|
||||||
// "./comics/covers/Ghosts and Ruins-001.jpg",
|
// "./comics/covers/Ghosts and Ruins-001.jpg",
|
||||||
// );
|
// );
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ export const unrar = async (
|
|||||||
const extractor = await unrarer.createExtractorFromData({ data: fileBuffer });
|
const extractor = await unrarer.createExtractorFromData({ data: fileBuffer });
|
||||||
switch (extractionOptions.extractTarget) {
|
switch (extractionOptions.extractTarget) {
|
||||||
case "cover":
|
case "cover":
|
||||||
|
debugger;
|
||||||
const list = extractor.getFileList();
|
const list = extractor.getFileList();
|
||||||
const fileHeaders = [...list.fileHeaders];
|
const fileHeaders = [...list.fileHeaders];
|
||||||
const file = extractor.extract({ files: [fileHeaders[0].name] });
|
const file = extractor.extract({ files: [fileHeaders[0].name] });
|
||||||
@@ -69,6 +70,7 @@ export const unrar = async (
|
|||||||
reject(error);
|
reject(error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
case "all":
|
case "all":
|
||||||
const files = extractor.extract({});
|
const files = extractor.extract({});
|
||||||
const extractedFiles = [...files.files];
|
const extractedFiles = [...files.files];
|
||||||
@@ -172,7 +174,6 @@ export const extractArchive = async (
|
|||||||
| IExtractedComicBookCoverFile[]
|
| IExtractedComicBookCoverFile[]
|
||||||
| IExtractComicBookCoverErrorResponse
|
| IExtractComicBookCoverErrorResponse
|
||||||
> => {
|
> => {
|
||||||
console.log(extractionOptions);
|
|
||||||
switch (extractionOptions.folderDetails.extension) {
|
switch (extractionOptions.folderDetails.extension) {
|
||||||
case ".cbz":
|
case ".cbz":
|
||||||
return await unzip(extractionOptions);
|
return await unzip(extractionOptions);
|
||||||
|
|||||||
Reference in New Issue
Block a user