diff --git a/library.ts b/library.ts index c556d28..43b3e84 100644 --- a/library.ts +++ b/library.ts @@ -100,13 +100,11 @@ on conflict(reader_url) } 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, { recursive: true, }); @@ -123,7 +121,7 @@ on conflict(reader_url) for (const [n, f] of Object.entries(files)) { await fs.copyFile( `${path}/${f}`, - `${opts.outDir}/${title}${ + `${opts.outDir}/${book.title}${ files.length > 1 ? ` - ${pad(n)}` : "" }.${f.split(".").at(-1)}`, ); @@ -133,7 +131,7 @@ on conflict(reader_url) 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) { if (err) { diff --git a/package-lock.json b/package-lock.json index e3ea5ab..0d8f132 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@fogtype/gadl", - "version": "1.4.2", + "version": "1.5.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@fogtype/gadl", - "version": "1.4.2", + "version": "1.5.0", "license": "AGPL-3.0", "dependencies": { "fflate": "^0.8.1", diff --git a/package.json b/package.json index 72b1ce1..f86f788 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@fogtype/gadl", - "version": "1.4.2", + "version": "1.5.0", "license": "AGPL-3.0", "type": "module", "bin": "bin/run.js",