Compare commits
No commits in common. "4669e1c0d4e1cc9f087bc72adebb28444910dbbd" and "8fece9090f962d587cf8ce29f66070c01ddb5c6c" have entirely different histories.
4669e1c0d4
...
8fece9090f
3
.gitignore
vendored
3
.gitignore
vendored
@ -14,8 +14,7 @@ app/**
|
|||||||
settings.json
|
settings.json
|
||||||
comic_config.json
|
comic_config.json
|
||||||
**/comic_config.json
|
**/comic_config.json
|
||||||
compile/
|
compiled/
|
||||||
compile/**
|
|
||||||
deploy-scripts/
|
deploy-scripts/
|
||||||
|
|
||||||
.pnpm-store/**
|
.pnpm-store/**
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"compile": "swc src --out-dir compile",
|
"compile": "swc src --out-dir compile",
|
||||||
"dev": "nodemon -r @swc-node/register --enable-source-maps --exec node app.ts",
|
"dev": "nodemon -r @swc-node/register --enable-source-maps --exec node app.ts",
|
||||||
"start": "node compile/src/app.js"
|
"start": "node compile/app.js"
|
||||||
},
|
},
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
|
@ -14,7 +14,7 @@ interface ComicDesc {
|
|||||||
character?: string[];
|
character?: string[];
|
||||||
tags?: string[];
|
tags?: string[];
|
||||||
}
|
}
|
||||||
const ImageExt = [".gif", ".png", ".jpeg", ".bmp", ".webp", ".jpg", ".avif"];
|
const ImageExt = [".gif", ".png", ".jpeg", ".bmp", ".webp", ".jpg"];
|
||||||
export class ComicReferrer extends createDefaultClass("comic") {
|
export class ComicReferrer extends createDefaultClass("comic") {
|
||||||
desc: ComicDesc | undefined;
|
desc: ComicDesc | undefined;
|
||||||
pagenum: number;
|
pagenum: number;
|
||||||
|
@ -21,20 +21,6 @@ class SqliteDocumentAccessor implements DocumentAccessor {
|
|||||||
throw new Error("Method not implemented.");
|
throw new Error("Method not implemented.");
|
||||||
}
|
}
|
||||||
async addList(content_list: DocumentBody[]): Promise<number[]> {
|
async addList(content_list: DocumentBody[]): Promise<number[]> {
|
||||||
if (content_list.length === 0) return [];
|
|
||||||
if (content_list.length > 256) {
|
|
||||||
// if content_list is too long, split it.
|
|
||||||
const chunkLength = 256;
|
|
||||||
const chunked = [];
|
|
||||||
for (let i = 0; i < content_list.length; i += chunkLength) {
|
|
||||||
chunked.push(content_list.slice(i, i + chunkLength));
|
|
||||||
}
|
|
||||||
const ids = [];
|
|
||||||
for (const chunk of chunked) {
|
|
||||||
ids.push(await this.addList(chunk));
|
|
||||||
}
|
|
||||||
return ids.flat();
|
|
||||||
}
|
|
||||||
return await this.kysely.transaction().execute(async (trx) => {
|
return await this.kysely.transaction().execute(async (trx) => {
|
||||||
// add tags
|
// add tags
|
||||||
const tagCollected = new Set<string>();
|
const tagCollected = new Set<string>();
|
||||||
|
@ -68,7 +68,7 @@ function releaseZip(path: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function renderZipImage(ctx: Context, path: string, page: number) {
|
async function renderZipImage(ctx: Context, path: string, page: number) {
|
||||||
const image_ext = ["gif", "png", "jpeg", "bmp", "webp", "jpg", "avif"];
|
const image_ext = ["gif", "png", "jpeg", "bmp", "webp", "jpg"];
|
||||||
const marked = markUseZip(path);
|
const marked = markUseZip(path);
|
||||||
const zip = await acquireZip(path, marked);
|
const zip = await acquireZip(path, marked);
|
||||||
const entries = (await entriesByNaturalOrder(zip)).filter((x) => {
|
const entries = (await entriesByNaturalOrder(zip)).filter((x) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user