fixed blocks
This commit is contained in:
parent
f242adb848
commit
527840e3ff
1 changed files with 13 additions and 6 deletions
|
@ -42,6 +42,8 @@ async function getFiles() {
|
|||
const conf = content.configuration.contents[index];
|
||||
const {
|
||||
No,
|
||||
DummyWidth,
|
||||
DummyHeight,
|
||||
Size: { Width, Height },
|
||||
} = file.FileLinkInfo.PageLinkInfoList[0].Page;
|
||||
|
||||
|
@ -51,14 +53,14 @@ async function getFiles() {
|
|||
`${conf["original-file-path"]}#-acs-position-${file.PageToBookmark[0][0]}-${file.PageToBookmark[0][1]}`,
|
||||
);
|
||||
|
||||
const w = [...page.url]
|
||||
.map((c) => c.charCodeAt())
|
||||
const w = [...`${conf.file}/${No}`]
|
||||
.map((c) => c.charCodeAt(0))
|
||||
.reduce((a, cc) => a + cc, 0);
|
||||
|
||||
const pattern = (w % NFBR.a0X.a3h) + 1;
|
||||
const blocks = NFBR.a3E.a3f(
|
||||
Width,
|
||||
Height,
|
||||
Width + DummyWidth,
|
||||
Height + DummyHeight,
|
||||
NFBR.a0X.a3g,
|
||||
NFBR.a0X.a3G,
|
||||
pattern,
|
||||
|
@ -66,7 +68,12 @@ async function getFiles() {
|
|||
|
||||
const url = `${a5w.url}${page.url}`;
|
||||
|
||||
files.push({ url, blocks, width: Width, height: Height });
|
||||
files.push({
|
||||
url,
|
||||
blocks,
|
||||
width: Width,
|
||||
height: Height,
|
||||
});
|
||||
}
|
||||
|
||||
return files;
|
||||
|
@ -148,7 +155,7 @@ export function DmmBooks({ db, browser }: { db: Database; browser: Browser }) {
|
|||
const page = await ctx.newPage();
|
||||
|
||||
// TODO: --all
|
||||
await fs.mkdir(dir);
|
||||
// await fs.mkdir(dir);
|
||||
await page.goto(book.readerUrl);
|
||||
|
||||
const files = await page.evaluate(getFiles);
|
||||
|
|
Loading…
Add table
Reference in a new issue