max volume calculation fix

This commit is contained in:
2022-07-06 18:47:20 +02:00
parent da58270bc5
commit ae44def45b
+3 -2
View File
@@ -354,8 +354,9 @@ async function main() {
let startVol = novel['lastVolume']; let startVol = novel['lastVolume'];
let totalChapters = chapters.length; let totalChapters = chapters.length;
const maxVolume = novel['completed'] ? startVol + 1 + Math.floor(totalChapters / novel['completedVolumeChapterCount']) : startVol + Math.floor(totalChapters / novel['completedVolumeChapterCount']); const maxVolume = novel['completed'] ? startVol + Math.ceil(totalChapters / novel['completedVolumeChapterCount']) : startVol + Math.floor(totalChapters / novel['completedVolumeChapterCount']);
const maxVolLen = (novel['completed'] ? maxVolume : maxVolume + Math.floor((chapters.length - (maxVolume + novel['completedVolumeChapterCount'])) / novel['volumeChapterCount'])).toString().length; const maxVolLen = (novel['completed'] ? maxVolume :
maxVolume + Math.floor((chapters.length - (maxVolume * novel['completedVolumeChapterCount'])) / novel['volumeChapterCount'])).toString().length;
let ebookAttachments = []; let ebookAttachments = [];