From f8e40ce9689e88dfe65f320c1d301ab698bfdd95 Mon Sep 17 00:00:00 2001 From: Gauthier Roebroeck Date: Tue, 12 Mar 2024 11:06:55 +0800 Subject: [PATCH] fix: some epub resources would not be detected properly Closes: #1442 Closes: #1441 --- .../infrastructure/mediacontainer/epub/EpubExtractor.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/komga/src/main/kotlin/org/gotson/komga/infrastructure/mediacontainer/epub/EpubExtractor.kt b/komga/src/main/kotlin/org/gotson/komga/infrastructure/mediacontainer/epub/EpubExtractor.kt index 83c38d244..560588340 100644 --- a/komga/src/main/kotlin/org/gotson/komga/infrastructure/mediacontainer/epub/EpubExtractor.kt +++ b/komga/src/main/kotlin/org/gotson/komga/infrastructure/mediacontainer/epub/EpubExtractor.kt @@ -14,6 +14,7 @@ import org.gotson.komga.infrastructure.mediacontainer.ContentDetector import org.jsoup.Jsoup import org.springframework.beans.factory.annotation.Value import org.springframework.stereotype.Service +import org.springframework.web.util.UriUtils import java.nio.file.Path import kotlin.io.path.Path import kotlin.io.path.invariantSeparatorsPathString @@ -98,7 +99,7 @@ class EpubExtractor( val pages = spine.map { page -> MediaFile( - normalizeHref(epub.opfDir, page.href), + normalizeHref(epub.opfDir, UriUtils.decode(page.href, Charsets.UTF_8)), page.mediaType, MediaFile.SubType.EPUB_PAGE, ) @@ -107,7 +108,7 @@ class EpubExtractor( val assets = epub.manifest.values.filterNot { spine.contains(it) }.map { MediaFile( - normalizeHref(epub.opfDir, it.href), + normalizeHref(epub.opfDir, UriUtils.decode(it.href, Charsets.UTF_8)), it.mediaType, MediaFile.SubType.EPUB_ASSET, )