🔧 Refactoring

This commit is contained in:
2022-04-17 19:38:31 -07:00
parent 9548db5d63
commit d53ab0432e
4 changed files with 17 additions and 19 deletions

4
package-lock.json generated
View File

@@ -35,6 +35,7 @@
"moleculer-db": "^0.8.17",
"moleculer-db-adapter-mongo": "^0.4.7",
"moleculer-db-adapter-mongoose": "^0.8.12",
"moleculer-io": "^2.0.0",
"moleculer-web": "^0.10.4",
"mongoosastic-ts": "^5.0.7",
"mongoose": "^5.12.7",
@@ -61,7 +62,6 @@
"install": "^0.13.0",
"jest": "^27.2.5",
"jest-cli": "^27.2.5",
"moleculer-io": "^2.0.0",
"moleculer-repl": "^0.7.0",
"npm": "^8.4.1",
"ts-jest": "^25.3.0",
@@ -9234,7 +9234,6 @@
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/moleculer-io/-/moleculer-io-2.0.0.tgz",
"integrity": "sha512-de/t7cG5at5KYPiukkR+cEnZ0nb0xRmSHkCoLrd7mmHfNI8+FwoUbg1fE2+Yt5aoEnVhpvY7UE2x8qcBOT6T3w==",
"dev": true,
"dependencies": {
"kleur": "^4.1.4",
"lodash": "^4.17.21",
@@ -22359,7 +22358,6 @@
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/moleculer-io/-/moleculer-io-2.0.0.tgz",
"integrity": "sha512-de/t7cG5at5KYPiukkR+cEnZ0nb0xRmSHkCoLrd7mmHfNI8+FwoUbg1fE2+Yt5aoEnVhpvY7UE2x8qcBOT6T3w==",
"dev": true,
"requires": {
"kleur": "^4.1.4",
"lodash": "^4.17.21",

View File

@@ -29,7 +29,6 @@
"install": "^0.13.0",
"jest": "^27.2.5",
"jest-cli": "^27.2.5",
"moleculer-io": "^2.0.0",
"moleculer-repl": "^0.7.0",
"npm": "^8.4.1",
"ts-jest": "^25.3.0",
@@ -47,6 +46,7 @@
"axios": "^0.25.0",
"axios-retry": "^3.2.4",
"bree": "^7.1.5",
"moleculer-io": "^2.0.0",
"chokidar": "^3.5.3",
"delay": "^5.0.0",
"dotenv": "^10.0.0",

View File

@@ -68,7 +68,7 @@ export default class SocketService extends Service {
actions: {},
methods: {},
async started() {
this.io.on("connection", (data) => console.log("Connected to socket.io server."))
this.io.on("connection", (data) => console.log("socket.io server initialized."))
}
},
schema

View File

@@ -32,23 +32,22 @@ SOFTWARE.
*/
import {
createWriteStream,
createReadStream,
promises as fs,
readFileSync,
existsSync,
createReadStream, createWriteStream,
existsSync
} from "fs";
import { isEmpty, isNil, isUndefined, remove } from "lodash";
import * as p7zip from "p7zip-threetwo";
import path from "path";
import sharp from "sharp";
import { IMPORT_IMAGE_FILE_FORMATS } from "../constants/allowedFileFormats";
import { USERDATA_DIRECTORY } from "../constants/directories";
import { checkFileExists, getFileConstituents } from "../utils/file.utils";
import { convertXMLToJSON } from "./xml.utils";
const fse = require("fs-extra");
const Unrar = require("unrar");
import path, { parse } from "path";
import * as p7zip from "p7zip-threetwo";
import { IExtractedComicBookCoverFile } from "threetwo-ui-typings";
import sharp from "sharp";
import { getFileConstituents, checkFileExists } from "../utils/file.utils";
import { flatten, isEmpty, isNil, isUndefined, remove } from "lodash";
import { convertXMLToJSON } from "./xml.utils";
import { USERDATA_DIRECTORY, COMICS_DIRECTORY } from "../constants/directories";
import { IMPORT_IMAGE_FILE_FORMATS } from "../constants/allowedFileFormats";
interface RarFile {
name: string;
type: string;
@@ -63,6 +62,7 @@ interface RarFile {
}
const UNRAR_BIN_PATH = process.env.UNRAR_BIN_PATH || "/opt/homebrew/bin/unrar";
export const extractComicInfoXMLFromRar = async (
filePath: string
): Promise<any> => {