🔧 Changed the type schema in uncompression utils
This commit is contained in:
@@ -1,8 +1,4 @@
|
||||
const sharp = require("sharp");
|
||||
const imghash = require("imghash");
|
||||
const leven = require("leven");
|
||||
import path from "path";
|
||||
import { isNull, reject } from "lodash";
|
||||
import { logger } from "./logger.utils";
|
||||
import { ISharpResizedImageStats } from "threetwo-ui-typings";
|
||||
|
||||
|
||||
@@ -97,14 +97,16 @@ export const extractCoverFromFile = async (
|
||||
// create renditions
|
||||
const renditionPath = constructedPaths.targetPath + "/" + walkedFolder.name + "_200px.jpg";
|
||||
const stats:ISharpResizedImageStats = await resizeImage(targetCoverImageFilePath, path.resolve(renditionPath), 200);
|
||||
|
||||
|
||||
resolve({
|
||||
name: walkedFolder.name,
|
||||
path: constructedPaths.targetPath + "/" + walkedFolder.name + "_200px.jpg", //renditionPath
|
||||
path: renditionPath,
|
||||
fileSize: stats.size,
|
||||
extension: path.extname(constructedPaths.inputFilePath),
|
||||
containedIn: walkedFolder.containedIn,
|
||||
//originalPath:
|
||||
//extension:
|
||||
calibreMetadata: {
|
||||
coverWriteResult: result,
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
@@ -239,8 +241,12 @@ export const unrar = async (
|
||||
resolve({
|
||||
name: `${extractedFiles[0].fileHeader.name}`,
|
||||
path: paths.targetPath,
|
||||
extension: path.extname(extractedFiles[0].fileHeader.name),
|
||||
fileSize: extractedFiles[0].fileHeader.packSize,
|
||||
containedIn: walkedFolder.containedIn,
|
||||
calibreMetadata: {
|
||||
coverWriteResult: "",
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
logger.error(`${error}: Couldn't write file.`);
|
||||
|
||||
Reference in New Issue
Block a user