🔧 Added a step to extract comicinfo.xml

This commit is contained in:
2022-02-28 09:51:45 -08:00
parent 36d18d4846
commit c67328c4d6
7 changed files with 217 additions and 153 deletions

View File

@@ -1,5 +1,5 @@
const mongoose = require("mongoose");
var mexp = require('mongoose-elasticsearch-xp').v7;
var mexp = require("mongoose-elasticsearch-xp").v7;
const paginate = require("mongoose-paginate-v2");
const { Client } = require("@elastic/elasticsearch");
@@ -12,77 +12,69 @@ export const eSClient = new Client({
},
});
const ComicSchema = mongoose.Schema({
importStatus: {
isImported: Boolean,
tagged: Boolean,
matchedResult: {
score: String,
const ComicSchema = mongoose.Schema(
{
importStatus: {
isImported: Boolean,
tagged: Boolean,
matchedResult: {
score: String,
},
},
},
userAddedMetadata: {
tags: [],
},
sourcedMetadata: {
comicInfo: {
blackAndWhite: String,
characters: [String],
count: String,
genre: String,
manga: String,
month: String,
number: String,
pageCount: String,
pages: [],
publisher: String,
summary: String,
title: String,
writer: String,
year: String,
userAddedMetadata: {
tags: [],
},
comicvine: {},
shortboxed: {},
gcd: {},
},
rawFileDetails: {
name: { type: String, es_indexed: true },
filePath: String,
fileSize: Number,
extension: String,
containedIn: String,
pageCount: Number,
cover: {
sourcedMetadata: {
comicInfo: { type: mongoose.Schema.Types.Mixed, default: {} },
comicvine: { type: mongoose.Schema.Types.Mixed, default: {} },
shortboxed: {},
gcd: {},
},
rawFileDetails: {
name: { type: String, es_indexed: true },
filePath: String,
stats: Object,
fileSize: Number,
extension: String,
containedIn: String,
pageCount: Number,
cover: {
filePath: String,
stats: Object,
},
calibreMetadata: {
coverWriteResult: String,
},
},
calibreMetadata :{
coverWriteResult: String,
}
},
inferredMetadata: {
issue: {
name: String,
number: { type: Number, es_indexed: true, required: false, default: 0 },
year: String,
subtitle: String,
}
},
acquisition: {
wanted: Boolean,
release: {},
directconnect: Array,
torrent: {
sourceApplication: String,
magnet: String,
tracker: String,
status: String,
inferredMetadata: {
issue: {
name: String,
number: {
type: Number,
es_indexed: true,
required: false,
default: 0,
},
year: String,
subtitle: String,
},
},
usenet: {
sourceApplication: String,
acquisition: {
wanted: Boolean,
release: {},
directconnect: Array,
torrent: {
sourceApplication: String,
magnet: String,
tracker: String,
status: String,
},
usenet: {
sourceApplication: String,
},
},
},
}, { timestamps: true});
{ timestamps: true, minimize: false }
);
ComicSchema.plugin(mexp, {
client: eSClient,