🎛 Tweaks to the DC++ downloads endpoint

This commit is contained in:
2022-07-28 09:11:44 -07:00
parent 3f37c43584
commit b0a7e42461
3 changed files with 13 additions and 14 deletions

View File

@@ -48,10 +48,10 @@ const LOCGSchema = mongoose.Schema({
potw: Number,
});
const DirectConnectBundleSchema = mongoose.Schema({
resultId: String,
bundleId: Number,
directoryIds: [String],
searchInstanceId: Number,
name: String,
size: String,
type: {},
});
const ComicSchema = mongoose.Schema(

View File

@@ -301,28 +301,28 @@ export default class ImportService extends Service {
params: {},
async handler(
ctx: Context<{
comicObjectId: string;
resultId: string;
bundleId: string;
directoryIds: [];
searchInstanceId: string;
bundleId: String;
comicObjectId: String,
name: String;
size: Number;
type: String;
}>
) {
console.log(JSON.stringify(ctx.params, null, 2))
const comicObjectId = new ObjectId(
ctx.params.comicObjectId
);
return new Promise((resolve, reject) => {
Comic.findByIdAndUpdate(
comicObjectId,
{
$push: {
"acquisition.directconnect.downloads": {
resultId: ctx.params.resultId,
bundleId: ctx.params.bundleId,
directoryIds:
ctx.params.directoryIds,
searchInstanceId:
ctx.params.searchInstanceId,
name: ctx.params.name,
size: ctx.params.size,
type: ctx.params.type,
},
},
},

View File

@@ -153,7 +153,6 @@ export default class SettingsService extends Service {
ctx: Context<{ bundleIds: [] }>
) => {
// params: array of bundle IDs
// construct the elasticsearch msearch query
if (!isNil(ctx.params.bundleIds)) {
return await Comic.find({
"acquisition.directconnect.downloads": {