🛠️ Fix toc.ncx may not be recognized due to different name

* Fixed issue with EPUB files, where toc.ncx is not recognized resulting in incorrect chapter names

Resolves: #122
This commit is contained in:
Acclorite 2024-12-16 13:26:51 +02:00
parent 36f600f9e1
commit 0d702f808f

View file

@ -48,7 +48,7 @@ class EpubTextParser @Inject constructor(
withContext(Dispatchers.IO) {
ZipFile(file).use { zip ->
val tocEntry = zip.entries().toList().find { entry ->
entry.name.endsWith("toc.ncx", ignoreCase = true)
entry.name.endsWith(".ncx", ignoreCase = true)
}
val opfEntry = zip.entries().toList().find { entry ->
entry.name.endsWith(".opf", ignoreCase = true)