🎛 Tweaks to the DC++ downloads endpoint
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -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": {
|
||||
|
||||
Reference in New Issue
Block a user