change file format
This commit is contained in:
parent
9479741b75
commit
27c4784793
3 changed files with 8 additions and 10 deletions
12
library.ts
12
library.ts
|
@ -100,13 +100,11 @@ on conflict(reader_url)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (book.authors.length > 0) {
|
if (book.authors.length > 0) {
|
||||||
book.title = `「${book.title}」`;
|
book.title = `[${book.authors
|
||||||
|
.slice(0, opts.outAuthorsLimit)
|
||||||
|
.join(", ")}] ${book.title}`.replace(/[/]/g, "%2F");
|
||||||
}
|
}
|
||||||
|
|
||||||
const title = `${book.authors.slice(0, opts.outAuthorsLimit).join("、")}${
|
|
||||||
book.title
|
|
||||||
}`.replace(/[/]/g, "%2F");
|
|
||||||
|
|
||||||
await fs.mkdir(opts.outDir, {
|
await fs.mkdir(opts.outDir, {
|
||||||
recursive: true,
|
recursive: true,
|
||||||
});
|
});
|
||||||
|
@ -123,7 +121,7 @@ on conflict(reader_url)
|
||||||
for (const [n, f] of Object.entries(files)) {
|
for (const [n, f] of Object.entries(files)) {
|
||||||
await fs.copyFile(
|
await fs.copyFile(
|
||||||
`${path}/${f}`,
|
`${path}/${f}`,
|
||||||
`${opts.outDir}/${title}${
|
`${opts.outDir}/${book.title}${
|
||||||
files.length > 1 ? ` - ${pad(n)}` : ""
|
files.length > 1 ? ` - ${pad(n)}` : ""
|
||||||
}.${f.split(".").at(-1)}`,
|
}.${f.split(".").at(-1)}`,
|
||||||
);
|
);
|
||||||
|
@ -133,7 +131,7 @@ on conflict(reader_url)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const out = createWriteStream(`${opts.outDir}/${title}.cbz`);
|
const out = createWriteStream(`${opts.outDir}/${book.title}.cbz`);
|
||||||
|
|
||||||
const zip = new Zip(function cb(err, data, final) {
|
const zip = new Zip(function cb(err, data, final) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|
4
package-lock.json
generated
4
package-lock.json
generated
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "@fogtype/gadl",
|
"name": "@fogtype/gadl",
|
||||||
"version": "1.4.2",
|
"version": "1.5.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@fogtype/gadl",
|
"name": "@fogtype/gadl",
|
||||||
"version": "1.4.2",
|
"version": "1.5.0",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"fflate": "^0.8.1",
|
"fflate": "^0.8.1",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@fogtype/gadl",
|
"name": "@fogtype/gadl",
|
||||||
"version": "1.4.2",
|
"version": "1.5.0",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"bin": "bin/run.js",
|
"bin": "bin/run.js",
|
||||||
|
|
Loading…
Add table
Reference in a new issue