🔎 Support for downloads endpoint

This commit is contained in:
2022-07-24 22:20:03 -07:00
parent 13e420e39c
commit 3f37c43584
7 changed files with 49 additions and 35 deletions

View File

@@ -47,6 +47,12 @@ const LOCGSchema = mongoose.Schema({
pulls: Number,
potw: Number,
});
const DirectConnectBundleSchema = mongoose.Schema({
resultId: String,
bundleId: Number,
directoryIds: [String],
searchInstanceId: Number,
});
const ComicSchema = mongoose.Schema(
{
@@ -58,7 +64,7 @@ const ComicSchema = mongoose.Schema(
},
},
userAddedMetadata: {
tags: [],
tags: [String],
},
sourcedMetadata: {
comicInfo: { type: mongoose.Schema.Types.Mixed, default: {} },
@@ -99,7 +105,13 @@ const ComicSchema = mongoose.Schema(
name: String,
},
release: {},
directconnect: Array,
directconnect: {
downloads: {
type: [DirectConnectBundleSchema],
es_indexed: true,
default: [],
},
},
torrent: {
sourceApplication: String,
magnet: String,
@@ -120,6 +132,19 @@ ComicSchema.plugin(mongoosastic, {
ComicSchema.plugin(paginate);
const Comic = mongoose.model("Comic", ComicSchema);
// Comic.createMapping({
// analysis: {
// analyzer: {
// content: {
// type: "custom",
// tokenizer: "whitespace",
// },
// },
// },
// }).then((data) => {
// console.log("Mapping the index...")
// console.log(data)
// })
// const stream = Comic.synchronize();
// let count = 0;

View File

@@ -16,7 +16,7 @@ const Issue = mongoose.Schema({
});
const VolumeInformation = mongoose.Schema({
_id: false,
aliases: [],
aliases: [String],
api_detail_url: String,
characters: [Things],
concepts: [Things],
@@ -68,7 +68,7 @@ const ComicVineMetadataSchema = mongoose.Schema({
api_detail_url: String,
has_staff_review: { type: mongoose.Schema.Types.Mixed },
cover_date: String,
cover_date: Date,
date_added: String,
date_last_updated: String,
deck: String,