🔧 Refactored the unrar and unzip return objects

This commit is contained in:
2022-03-19 10:12:11 -07:00
parent e144c9dd5f
commit 8181afdf88
2 changed files with 8 additions and 11 deletions

View File

@@ -163,14 +163,14 @@ export default class QueueService extends Service {
const foo = await this.getQueue(
"process.import"
).pause();
console.log(foo);
break;
console.log("paused", foo);
return foo;
case "resume":
const soo = await this.getQueue(
"process.import"
).resume();
console.log(soo);
break;
console.log("resumed", soo);
return soo;
default:
console.log("Unrecognized queue action.");
}

View File

@@ -153,7 +153,6 @@ export const extractComicInfoXMLFromRar = async (
}
if (existsSync(`${targetDirectory}/${coverFile}`)) {
// orchestrate result
console.log("ASDAsd");
resolve({
filePath,
name: fileNameWithoutExtension,
@@ -220,7 +219,6 @@ export const extractComicInfoXMLFromZip = async (
// ComicInfoXML detection, parsing and conversion to JSON
// Write ComicInfo.xml to disk
let comicinfostring = "";
const comicInfoXMLPromise = new Promise((resolve, reject) => {
if (
!isNil(filesToWriteToDisk.comicInfoXML) &&
@@ -296,16 +294,15 @@ export const extractFromArchive = async (filePath: string) => {
console.log(
"Detected file type is cbz, looking for comicinfo.xml..."
);
const result = await extractComicInfoXMLFromZip(filePath);
return Object.assign({}, ...result);
const cbzResult = await extractComicInfoXMLFromZip(filePath);
return Object.assign({}, ...cbzResult);
case ".cbr":
console.log(
"Detected file type is cbr, looking for comicinfo.xml..."
);
const CbrResult = await extractComicInfoXMLFromRar(filePath);
console.log(CbrResult);
return Object.assign({}, ...CbrResult);
const cbrResult = await extractComicInfoXMLFromRar(filePath);
return Object.assign({}, ...cbrResult);
default:
console.log(