fix: merge conflict.

Signed-off-by: KaiserBh <kaiserbh@proton.me>
This commit is contained in:
KaiserBh
2023-11-14 14:09:17 +11:00
81 changed files with 648 additions and 391 deletions

View File

@ -80,7 +80,7 @@ class EpubFile(file: File) : Closeable {
/**
* Returns all the pages from the epub.
*/
fun getPagesFromDocument(document: Document): List<String> {
private fun getPagesFromDocument(document: Document): List<String> {
val pages = document.select("manifest > item")
.filter { node -> "application/xhtml+xml" == node.attr("media-type") }
.associateBy { it.attr("id") }
@ -102,10 +102,9 @@ class EpubFile(file: File) : Closeable {
val imageBasePath = getParentDirectory(entryPath)
document.allElements.forEach {
if (it.tagName() == "img") {
result.add(resolveZipPath(imageBasePath, it.attr("src")))
} else if (it.tagName() == "image") {
result.add(resolveZipPath(imageBasePath, it.attr("xlink:href")))
when (it.tagName()) {
"img" -> result.add(resolveZipPath(imageBasePath, it.attr("src")))
"image" -> result.add(resolveZipPath(imageBasePath, it.attr("xlink:href")))
}
}
}