Compare commits

..

No commits in common. "27c47847936ce8ebec3b953a3accb6c7a60d2d02" and "bf83e1cf0bcb7e33699f471faee654063d12ed19" have entirely different histories.

3 changed files with 11 additions and 14 deletions

View file

@ -100,14 +100,12 @@ on conflict(reader_url)
}
if (book.authors.length > 0) {
book.title = `[${book.authors
.slice(0, opts.outAuthorsLimit)
.join(", ")}] ${book.title}`.replace(/[/]/g, "%2F");
book.title = `${book.title}`;
}
await fs.mkdir(opts.outDir, {
recursive: true,
});
const title = `${book.authors.slice(0, opts.outAuthorsLimit).join("、")}${
book.title
}`.replace(/[/]/g, "%2F");
const files = await fs.readdir(path);
@ -119,19 +117,18 @@ on conflict(reader_url)
}
for (const [n, f] of Object.entries(files)) {
await fs.copyFile(
await fs.rename(
`${path}/${f}`,
`${opts.outDir}/${book.title}${
`${opts.outDir}/${title}${
files.length > 1 ? ` - ${pad(n)}` : ""
}.${f.split(".").at(-1)}`,
);
}
await fs.rm(path, { recursive: true });
await fs.rmdir(path);
return;
}
const out = createWriteStream(`${opts.outDir}/${book.title}.cbz`);
const out = createWriteStream(`${opts.outDir}/${title}.cbz`);
const zip = new Zip(function cb(err, data, final) {
if (err) {

4
package-lock.json generated
View file

@ -1,12 +1,12 @@
{
"name": "@fogtype/gadl",
"version": "1.5.0",
"version": "1.4.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@fogtype/gadl",
"version": "1.5.0",
"version": "1.4.1",
"license": "AGPL-3.0",
"dependencies": {
"fflate": "^0.8.1",

View file

@ -1,6 +1,6 @@
{
"name": "@fogtype/gadl",
"version": "1.5.0",
"version": "1.4.2",
"license": "AGPL-3.0",
"type": "module",
"bin": "bin/run.js",