🛠️ Get only "content.opf" in EpubFileParser

* Can prevent other ".opf" file to ruin book's parsing
This commit is contained in:
Acclorite 2024-10-06 20:39:57 +03:00
parent a063a5d1cb
commit dcdc7851d6

View file

@ -24,7 +24,7 @@ class EpubFileParser @Inject constructor() : FileParser {
withContext(Dispatchers.IO) { withContext(Dispatchers.IO) {
ZipFile(file).use { zip -> ZipFile(file).use { zip ->
val opfEntry = zip.entries().asSequence().find { entry -> val opfEntry = zip.entries().asSequence().find { entry ->
entry.name.endsWith(".opf") entry.name.endsWith("content.opf")
} ?: return@withContext } ?: return@withContext
val opfContent = zip val opfContent = zip