🪢 Rewired the download -> import to lib workflow
This commit is contained in:
@@ -71,6 +71,7 @@ export default class QueueService extends Service {
|
|||||||
const {
|
const {
|
||||||
name,
|
name,
|
||||||
filePath,
|
filePath,
|
||||||
|
fileSize,
|
||||||
extension,
|
extension,
|
||||||
cover,
|
cover,
|
||||||
containedIn,
|
containedIn,
|
||||||
@@ -100,7 +101,7 @@ export default class QueueService extends Service {
|
|||||||
rawFileDetails: {
|
rawFileDetails: {
|
||||||
name,
|
name,
|
||||||
filePath,
|
filePath,
|
||||||
fileSize: job.data.fileObject.fileSize,
|
fileSize,
|
||||||
extension,
|
extension,
|
||||||
containedIn,
|
containedIn,
|
||||||
cover,
|
cover,
|
||||||
|
|||||||
@@ -332,9 +332,9 @@ export default class ImportService extends Service {
|
|||||||
);
|
);
|
||||||
console.log(result);
|
console.log(result);
|
||||||
await Comic.findOneAndUpdate({ _id: new ObjectId(ctx.params.comicObjectId) }, {
|
await Comic.findOneAndUpdate({ _id: new ObjectId(ctx.params.comicObjectId) }, {
|
||||||
rawFileDetails: {
|
rawFileDetails: result,
|
||||||
|
acquisition: { wanted: false, }
|
||||||
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export default class OpdsService extends Service {
|
|||||||
},
|
},
|
||||||
hooks: {},
|
hooks: {},
|
||||||
actions: {
|
actions: {
|
||||||
opds: {
|
serve: {
|
||||||
rest: "POST /serve",
|
rest: "POST /serve",
|
||||||
handler: async (ctx) => {
|
handler: async (ctx) => {
|
||||||
return buildAsync(
|
return buildAsync(
|
||||||
@@ -137,18 +137,4 @@ export default class OpdsService extends Service {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// router.use("/file/*", async (req, res) => {
|
|
||||||
// const file: string = req.params[0];
|
|
||||||
// const ext = extname(file);
|
|
||||||
|
|
||||||
// if ([".cbr", ".cbz", ".cb7", ".cba", ".cbt"].includes(ext)) {
|
|
||||||
// const content = await fs.readFile(join(path_of_books, file));
|
|
||||||
// const mime = lookup(ext) || "application/octet-stream";
|
|
||||||
// res.set("Content-Type", mime);
|
|
||||||
// return responseStream(res, content);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// res.status(404).end(`'${file}' not exists`);
|
|
||||||
// });
|
|
||||||
@@ -31,7 +31,7 @@ SOFTWARE.
|
|||||||
* Initial: 2021/05/04 Rishi Ghan
|
* Initial: 2021/05/04 Rishi Ghan
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { createReadStream, createWriteStream, existsSync } from "fs";
|
import { createReadStream, createWriteStream, existsSync, statSync } from "fs";
|
||||||
import { isEmpty, isNil, isUndefined, remove, each, map } from "lodash";
|
import { isEmpty, isNil, isUndefined, remove, each, map } from "lodash";
|
||||||
import * as p7zip from "p7zip-threetwo";
|
import * as p7zip from "p7zip-threetwo";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
@@ -160,6 +160,7 @@ export const extractComicInfoXMLFromRar = async (
|
|||||||
name: fileNameWithoutExtension,
|
name: fileNameWithoutExtension,
|
||||||
extension,
|
extension,
|
||||||
containedIn: targetDirectory,
|
containedIn: targetDirectory,
|
||||||
|
fileSize: fse.statSync(filePath).size,
|
||||||
cover: {
|
cover: {
|
||||||
filePath: path.relative(
|
filePath: path.relative(
|
||||||
process.cwd(),
|
process.cwd(),
|
||||||
@@ -284,6 +285,7 @@ export const extractComicInfoXMLFromZip = async (
|
|||||||
name: fileNameWithoutExtension,
|
name: fileNameWithoutExtension,
|
||||||
extension,
|
extension,
|
||||||
containedIn: targetDirectory,
|
containedIn: targetDirectory,
|
||||||
|
fileSize: fse.statSync(filePath).size,
|
||||||
cover: {
|
cover: {
|
||||||
filePath: path.relative(
|
filePath: path.relative(
|
||||||
process.cwd(),
|
process.cwd(),
|
||||||
|
|||||||
Reference in New Issue
Block a user