Update lastest chapter logic (#853)

* update lastestchapter logic

* update version
This commit is contained in:
nyagami
2024-03-24 13:53:43 +07:00
committed by GitHub
parent 5f9a067ab9
commit cda9a0baac
5 changed files with 29 additions and 51 deletions
-2
View File
@@ -197,8 +197,6 @@
<span class="sr-only">Loading...</span>
</div>
<div class="parsed-page-info">
<div class="latest-chapter-item">
</div>
<div class="chapter-list-container">
<div class="chapter-list">
</div>
+5 -7
View File
@@ -849,6 +849,11 @@ class PluginWrapper {
),
);
}
if (sourceNovel.latestChapter) {
novel_data
.children('div + div')
.append(PluginWrapper.createChapterItem(sourceNovel.latestChapter));
}
novel_item.replaceWith(novel_data);
if (
@@ -872,7 +877,6 @@ class PluginWrapper {
/** @type {JQuery<HTMLInputElement>} */
const novelPathInput = $('#parsePage #parse-page-novel-path');
const pageInput = $('#parsePage #parse-page-index');
const latestChapter_item = $('#parseNovel latest-chapter-item');
const chapter_list = $('#parsePage .chapter-list');
const novelPath = novelPathInput.val();
const page = pageInput.val();
@@ -895,12 +899,6 @@ class PluginWrapper {
).json();
if ('error' in sourcePage)
throw `Error getting the novel ${sourcePage.error}`;
latestChapter_item.empty();
if (sourcePage.latestChapter) {
latestChapter_item.append(
PluginWrapper.createChapterItem(sourcePage.latestChapter),
);
}
if (
sourcePage?.chapters?.length !==
new Set(sourcePage?.chapters?.map(r => r.path) || []).size