🧹 Removed the useless getPageCount method

This commit is contained in:
2021-10-06 14:10:44 -07:00
parent 5862d71c06
commit e61268f9ae
2 changed files with 7 additions and 30 deletions

View File

@@ -142,6 +142,7 @@ export const unrarArchive = async (
console.error("Failed to read file", err)
);
try {
logger.info("Unrar initiating.")
await fse.ensureDir(options.targetExtractionFolder, directoryOptions);
logger.info(`${options.targetExtractionFolder} was created.`);
@@ -158,26 +159,15 @@ export const unrarArchive = async (
const fileName = explodePath(
file.fileHeader.name
).fileName;
await fse.writeFile(
options.targetExtractionFolder + "/" + fileName,
fileBuffer
// resize image
await resizeImage(
fileBuffer,
path.resolve(options.targetExtractionFolder + "/" + fileName),
200
);
// folder.forEach(async (page) => {
// await resizeImage(
// page.path + "/" + page.name + page.extension,
// path.resolve(options.targetExtractionFolder + "/" + page.name + page.extension),
// 200
// );
// });
// walk the newly created folder and return results
}
// walk the newly created folder and return results
return await walkFolder(options.targetExtractionFolder, [
".jpg",
".png",
@@ -188,8 +178,3 @@ export const unrarArchive = async (
logger.error(`${error}`);
}
};
export const getPageCountFromRarArchive = async (filePath: string) => {
const pageCount = await list(filePath);
return pageCount.length;
};