From cc857ef855b41bc25c6ced488fe609d7904c9b55 Mon Sep 17 00:00:00 2001 From: Daniel Bulant Date: Fri, 28 May 2021 16:32:06 +0200 Subject: [PATCH] fix ordering of chapters in some readers --- src/util/generateCbz.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/util/generateCbz.js b/src/util/generateCbz.js index f350f48..8ff0525 100644 --- a/src/util/generateCbz.js +++ b/src/util/generateCbz.js @@ -33,7 +33,8 @@ export class CBZGenerator extends BaseGenerator { const URL = `${baseUrl}/${this.opts.quality}/${chapter.hash}/${hash}`; const start = performance.now(); const res = await this.fetchImage(URL); - const image = new ZipPassThrough(`${this.opts.title} ${chapter.number.toString().padStart(chapterCountLength, "0")}/${i.toString().padStart(imageCountLength, "0")}.${hash.substr(hash.lastIndexOf(".") + 1)}`); + const chapterText = chapter.number.toString().padStart(chapterCountLength, "0"); + const image = new ZipPassThrough(`${this.opts.title} ${chapterText}/${chapterText} page ${i.toString().padStart(imageCountLength, "0")}.${hash.substr(hash.lastIndexOf(".") + 1)}`); this.zip.add(image); const data = new Uint8Array(await res.arrayBuffer()); const end = performance.now() - start; @@ -45,6 +46,7 @@ export class CBZGenerator extends BaseGenerator { url: URL }); image.push(data, true); + this.callback(chapterI, i, true); } } this.zip.end();