🔧 Cleaned up unused code and bumped filename-parser

This commit is contained in:
2022-02-07 09:56:08 -08:00
parent bfb1f7fa28
commit 8bb74404fc
8 changed files with 24 additions and 76 deletions

View File

@@ -152,11 +152,14 @@ export default class ImportService extends Service {
async handler(
ctx: Context<{
sourcedMetadata: {
comicvine: {
comicvine?: {
volume: { api_detail_url: string };
volumeInformation: {};
};
};
inferredMetadata: {
issue: Object,
},
rawFileDetails: {
name: string;
};
@@ -164,6 +167,8 @@ export default class ImportService extends Service {
) {
let volumeDetails;
const comicMetadata = ctx.params;
// When an issue is added from the search CV feature
if (
comicMetadata.sourcedMetadata.comicvine &&
!isNil(
@@ -186,11 +191,13 @@ export default class ImportService extends Service {
if (data) {
resolve(data);
} else if (error) {
console.log("data", data);
console.log("error", error)
throw new Errors.MoleculerError(
"Failed to import comic book",
400,
"IMS_FAILED_COMIC_BOOK_IMPORT",
data
error
);
}
});
@@ -411,12 +418,6 @@ export default class ImportService extends Service {
elasticSearchQuery = {
bool: {
must: [
// {
// match_phrase: {
// "rawFileDetails.name":
// queryObject.issueName,
// },
// },
{
match_phrase: {
"rawFileDetails.name":