📚 Changes to CV model
This commit is contained in:
@@ -117,7 +117,7 @@ export default class ImportService extends Service {
|
||||
filePath: ctx.params.filePath,
|
||||
comicObjectId: ctx.params.comicObjectId,
|
||||
options: ctx.params.options,
|
||||
queueName: "uncompressFullArchive.async",
|
||||
action: "uncompressFullArchive.async",
|
||||
description: `Job for uncompressing archive at ${ctx.params.filePath}`,
|
||||
});
|
||||
},
|
||||
@@ -260,11 +260,13 @@ export default class ImportService extends Service {
|
||||
rawFileDetails: {
|
||||
name: string;
|
||||
};
|
||||
wanted: {
|
||||
issues: [];
|
||||
volume: {};
|
||||
source: string;
|
||||
markEntireVolumeWanted: Boolean;
|
||||
};
|
||||
acquisition: {
|
||||
source: {
|
||||
wanted: boolean;
|
||||
name?: string;
|
||||
};
|
||||
directconnect: {
|
||||
downloads: [];
|
||||
};
|
||||
@@ -275,27 +277,6 @@ export default class ImportService extends Service {
|
||||
try {
|
||||
let volumeDetails;
|
||||
const comicMetadata = ctx.params.payload;
|
||||
// When an issue is added from the search CV feature
|
||||
// we solicit volume information and add that to mongo
|
||||
if (
|
||||
comicMetadata.sourcedMetadata.comicvine &&
|
||||
!isNil(
|
||||
comicMetadata.sourcedMetadata.comicvine
|
||||
.volume
|
||||
)
|
||||
) {
|
||||
volumeDetails = await this.broker.call(
|
||||
"comicvine.getVolumes",
|
||||
{
|
||||
volumeURI:
|
||||
comicMetadata.sourcedMetadata
|
||||
.comicvine.volume
|
||||
.api_detail_url,
|
||||
}
|
||||
);
|
||||
comicMetadata.sourcedMetadata.comicvine.volumeInformation =
|
||||
volumeDetails.results;
|
||||
}
|
||||
|
||||
console.log("Saving to Mongo...");
|
||||
console.log(
|
||||
|
||||
@@ -100,12 +100,19 @@ export default class SettingsService extends Service {
|
||||
case "wanted":
|
||||
Object.assign(eSQuery, {
|
||||
bool: {
|
||||
must: {
|
||||
term: {
|
||||
"acquisition.source.wanted":
|
||||
true,
|
||||
should: [
|
||||
{
|
||||
exists: {
|
||||
field: "wanted.issues",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
exists: {
|
||||
field: "wanted.volume",
|
||||
},
|
||||
},
|
||||
],
|
||||
minimum_should_match: 1,
|
||||
},
|
||||
});
|
||||
break;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
"use strict";
|
||||
import axios from "axios";
|
||||
import {
|
||||
Context,
|
||||
Service,
|
||||
@@ -9,8 +8,6 @@ import {
|
||||
} from "moleculer";
|
||||
import { DbMixin } from "../mixins/db.mixin";
|
||||
import Comic from "../models/comic.model";
|
||||
const ObjectId = require("mongoose").Types.ObjectId;
|
||||
import { isNil, isUndefined } from "lodash";
|
||||
import BullMqMixin from "moleculer-bullmq";
|
||||
const { MoleculerError } = require("moleculer").Errors;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user