Add harkeneliwood + Updated duplicate check for chapter paths. (#905)

* ajout harkeneliwood + Updated duplicate check for chapter paths.

* Perf

* Delete async getSummary and getAuthor
This commit is contained in:
Elfing
2024-04-28 11:12:11 +02:00
committed by GitHub
parent d96843da3b
commit 1ca7009d26
3 changed files with 201 additions and 5 deletions
+17 -5
View File
@@ -856,11 +856,23 @@ class PluginWrapper {
}
novel_item.replaceWith(novel_data);
if (
sourceNovel?.chapters?.length !==
new Set(sourceNovel?.chapters?.map(r => r.path) || []).size
) {
alert('Chapter paths are the same!');
const chapterPaths = new Set();
const duplicatePaths = new Set();
sourceNovel?.chapters?.forEach(chapter => {
const path = chapter.path;
if (chapterPaths.has(path)) {
duplicatePaths.add(path);
} else {
chapterPaths.add(path);
}
});
if (duplicatePaths.size > 0) {
alert(
'Duplicate chapter paths found: ' +
Array.from(duplicatePaths).join(', '),
);
}
chapter_list.html('');