|
|
|
@ -126,6 +126,9 @@ exports.manga = async (req, res)=>
|
|
|
|
|
const sortedChapters = chaptersRead.sort((a, b) => a.chapterNum - b.chapterNum);
|
|
|
|
|
const sortedAndFilteredChapters = sortedChapters.filter(item=> item.lastImageRead && !item.completely);
|
|
|
|
|
const lastChapterWithReadImages=sortedAndFilteredChapters.shift();
|
|
|
|
|
const isMangaFullyRead = lastChapterWithReadImages?.chNum >= manga.List.pop().num || lastCompletelyRead?.chNum >= manga.List.pop().num;
|
|
|
|
|
manga['fullyRead'] = isMangaFullyRead;
|
|
|
|
|
manga['isDownloaded'] = false //TODO
|
|
|
|
|
let chapterNumToContinue = getChapterNumToContinue(lastCompletelyRead, lastChapterWithReadImages, manga.List);
|
|
|
|
|
if(!manga.List.some(item=> item.num==chapterNumToContinue)) chapterNumToContinue = Math.trunc(chapterNumToContinue);
|
|
|
|
|
if(lastCompletelyRead || lastChapterWithReadImages)
|
|
|
|
|