Fix local source EPUB files not loading (#2369)
(cherry picked from commit 9bf3f15fff96b48e6847034c9fcd07f14675130b)
This commit is contained in:
@@ -3,6 +3,7 @@ package eu.kanade.tachiyomi.util.storage
|
||||
import mihon.core.common.archive.ArchiveReader
|
||||
import org.jsoup.Jsoup
|
||||
import org.jsoup.nodes.Document
|
||||
import org.jsoup.parser.Parser
|
||||
import java.io.Closeable
|
||||
import java.io.File
|
||||
import java.io.InputStream
|
||||
@@ -40,7 +41,7 @@ class EpubFile(private val reader: ArchiveReader) : Closeable by reader {
|
||||
fun getPackageHref(): String {
|
||||
val meta = getInputStream(resolveZipPath("META-INF", "container.xml"))
|
||||
if (meta != null) {
|
||||
val metaDoc = meta.use { Jsoup.parse(it, null, "") }
|
||||
val metaDoc = meta.use { Jsoup.parse(it, null, "", Parser.xmlParser()) }
|
||||
val path = metaDoc.getElementsByTag("rootfile").first()?.attr("full-path")
|
||||
if (path != null) {
|
||||
return path
|
||||
@@ -53,7 +54,7 @@ class EpubFile(private val reader: ArchiveReader) : Closeable by reader {
|
||||
* Returns the package document where all the files are listed.
|
||||
*/
|
||||
fun getPackageDocument(ref: String): Document {
|
||||
return getInputStream(ref)!!.use { Jsoup.parse(it, null, "") }
|
||||
return getInputStream(ref)!!.use { Jsoup.parse(it, null, "", Parser.xmlParser()) }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user