Added mimetype checker lib

This commit is contained in:
2023-03-17 12:37:58 -04:00
parent 8b814c0ac5
commit 725f948f01
4 changed files with 240 additions and 197 deletions

View File

@@ -44,6 +44,7 @@ import {
getFileConstituents,
createDirectory,
walkFolder,
getMimeType,
} from "../utils/file.utils";
import { convertXMLToJSON } from "./xml.utils";
const fse = require("fs-extra");
@@ -346,6 +347,8 @@ export const extractFromArchive = async (filePath: string) => {
console.log(
`Detected file type is ${extension}, looking for comicinfo.xml...`
);
const mimeType = await getMimeType(filePath);
console.log(`File has the following mime-type: ${mimeType}`);
switch (extension) {
case ".cbz":
case ".cb7":