821938089 hace 4 años
padre
commit
683484830e

+ 0 - 3
app/src/main/java/io/legado/app/model/localBook/EpubFile.kt

@@ -257,9 +257,6 @@ class EpubFile(var book: Book) {
             } else {
                 parseFirstPage(chapterList, refs)
                 parseMenu(chapterList, refs, 0)
-                val lh = LinkedHashSet(chapterList)
-                chapterList.clear()
-                chapterList.addAll(lh)
                 for (i in chapterList.indices) {
                     chapterList[i].index = i
                 }

+ 1 - 0
app/src/main/java/io/legado/app/model/localBook/LocalBook.kt

@@ -79,6 +79,7 @@ object LocalBook {
             throw TocEmptyException(appCtx.getString(R.string.chapter_list_empty))
         }
         val lh = LinkedHashSet(chapters)
+        lh.forEachIndexed { index, bookChapter -> bookChapter.index = index }
         return ArrayList(lh)
     }