🔧 Refactored methods into utils

This commit is contained in:
2021-06-14 10:46:38 -07:00
parent 06d0c6aa72
commit 2bf74985a1
9 changed files with 244 additions and 116 deletions

View File

@@ -100,7 +100,7 @@ export default class ApiService extends Service {
this.logger.info("Client connected via websocket!");
client.on(
"call",
"importComicsInDB",
async ({ action, params, opts }, done) => {
this.logger.info(
"Received request from client! Action:",
@@ -117,11 +117,27 @@ export default class ApiService extends Service {
extractionOptions,
folder
);
const dbImportResult =
await this.broker.call(
"import.rawImportToDB",
{
importStatus: {
isImported: true,
tagged: false,
matchedResult: {
score: "0",
},
},
rawFileDetails:
comicBookCoverMetadata,
},
{}
);
client.emit(
"comicBookCoverMetadata",
comicBookCoverMetadata
);
client.emit("comicBookCoverMetadata", {
comicBookCoverMetadata,
dbImportResult,
});
});
case "single":