🔧 Fixing the ebook-meta path

This commit is contained in:
2021-09-07 08:47:13 -07:00
parent c7d431343d
commit 36d1c4fe33
2 changed files with 1 additions and 8 deletions

View File

@@ -43,10 +43,8 @@ export const calculateLevenshteinDistance = async (
imagePath1: string,
imagePath2: string
): Promise<Record<string, unknown>> => {
console.log("AGANTUK", imagePath1)
const hash1 = await imghash.hash(imagePath1);
const hash2 = await imghash.hash(imagePath2);
console.log("HASHISH", hash1)
if (!isNull(hash1) && !isNull(hash2)) {
return new Promise((resolve, reject) => {
resolve({ levenshteinDistance: leven(hash1, hash2) });

View File

@@ -31,13 +31,10 @@ SOFTWARE.
* Initial: 2021/05/04 Rishi Ghan
*/
import { createReadStream, createWriteStream, readFileSync, stat } from "fs";
const fse = require("fs-extra");
import path from "path";
import { each, isEmpty, map, flatten } from "lodash";
import {
IExplodedPathResponse,
IExtractComicBookCoverErrorResponse,
IExtractedComicBookCoverFile,
IExtractionOptions,
@@ -45,11 +42,9 @@ import {
ISharpResizedImageStats,
} from "threetwo-ui-typings";
import { logger } from "./logger.utils";
import { validateComicBookMetadata } from "../utils/validation.utils";
import {
constructPaths,
explodePath,
isValidImageFileExtension,
} from "../utils/file.utils";
import { resizeImage } from "./imagetransformation.utils";
const { writeFile, readFile } = require("fs").promises;
@@ -89,7 +84,7 @@ export const extractCoverFromFile = async (
let result: string;
const targetCoverImageFilePath = path.resolve(constructedPaths.targetPath + "/" + walkedFolder.name + "_cover.jpg")
result = await calibre.run(
`/opt/calibre/ebook-meta`,
`ebook-meta`,
[path.resolve(constructedPaths.inputFilePath)],
{
getCover: targetCoverImageFilePath,