mirror of
https://github.com/danbulant/Mangades
synced 2026-07-07 12:00:36 +00:00
fix downloads of chapters without numbers
This commit is contained in:
parent
5de3e55d43
commit
a4954b6177
2 changed files with 4 additions and 1 deletions
|
|
@ -21,7 +21,6 @@ export class CBZGenerator extends BaseGenerator {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.hashes = this.opts.chapters.map(t => t.links).flat();
|
this.hashes = this.opts.chapters.map(t => t.links).flat();
|
||||||
|
|
||||||
const chapterCountLength = this.opts.chapters.reduce((a, b) => Math.max(a.number, b.number), 0).toString().length;
|
const chapterCountLength = this.opts.chapters.reduce((a, b) => Math.max(a.number, b.number), 0).toString().length;
|
||||||
for(const chapterI in this.opts.chapters) {
|
for(const chapterI in this.opts.chapters) {
|
||||||
const chapter = this.opts.chapters[chapterI];
|
const chapter = this.opts.chapters[chapterI];
|
||||||
|
|
@ -31,6 +30,9 @@ export class CBZGenerator extends BaseGenerator {
|
||||||
chapter.hashes = data.hashes;
|
chapter.hashes = data.hashes;
|
||||||
chapter.hash = data.hash;
|
chapter.hash = data.hash;
|
||||||
}
|
}
|
||||||
|
if(typeof chapter.number == "undefined" || chapter.number == null) {
|
||||||
|
chapter.number = chapterI;
|
||||||
|
}
|
||||||
const imageCountLength = chapter.links.length.toString().length;
|
const imageCountLength = chapter.links.length.toString().length;
|
||||||
for(const i in chapter.links) {
|
for(const i in chapter.links) {
|
||||||
let url = chapter.links[i];
|
let url = chapter.links[i];
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@ export class EpubGenerator extends BaseGenerator {
|
||||||
|
|
||||||
for(const chapterI in this.opts.chapters) {
|
for(const chapterI in this.opts.chapters) {
|
||||||
const chapter = this.opts.chapters[chapterI];
|
const chapter = this.opts.chapters[chapterI];
|
||||||
|
if(chapter.number == null || chapter.number == undefined) chapter.number = chapterI;
|
||||||
for(const i in chapter.links) {
|
for(const i in chapter.links) {
|
||||||
let url = chapter.links[i];
|
let url = chapter.links[i];
|
||||||
let hash = chapter.hashes[i];
|
let hash = chapter.hashes[i];
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue