mirror of
https://github.com/gotson/komga.git
synced 2026-05-08 12:35:30 +02:00
fix(zip extractor): better handling of exotic charsets
replacement of java.util.zip.ZipFile by org.apache.commons.compress.archivers.zip.ZipFile closes #41
This commit is contained in:
parent
fcfe78b7be
commit
0254d7d867
2 changed files with 4 additions and 3 deletions
|
|
@ -66,6 +66,7 @@ dependencies {
|
||||||
implementation("org.apache.commons:commons-lang3:3.9")
|
implementation("org.apache.commons:commons-lang3:3.9")
|
||||||
|
|
||||||
implementation("org.apache.tika:tika-core:1.23")
|
implementation("org.apache.tika:tika-core:1.23")
|
||||||
|
implementation("org.apache.commons:commons-compress:1.19")
|
||||||
implementation("com.github.junrar:junrar:4.0.0")
|
implementation("com.github.junrar:junrar:4.0.0")
|
||||||
implementation("org.apache.pdfbox:pdfbox:2.0.17")
|
implementation("org.apache.pdfbox:pdfbox:2.0.17")
|
||||||
implementation("net.grey-panther:natural-comparator:1.1")
|
implementation("net.grey-panther:natural-comparator:1.1")
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
package org.gotson.komga.infrastructure.archive
|
package org.gotson.komga.infrastructure.archive
|
||||||
|
|
||||||
|
import org.apache.commons.compress.archivers.zip.ZipFile
|
||||||
import org.gotson.komga.domain.model.BookPage
|
import org.gotson.komga.domain.model.BookPage
|
||||||
import org.springframework.stereotype.Service
|
import org.springframework.stereotype.Service
|
||||||
import java.nio.file.Path
|
import java.nio.file.Path
|
||||||
import java.util.zip.ZipFile
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
class ZipExtractor(
|
class ZipExtractor(
|
||||||
|
|
@ -12,7 +12,7 @@ class ZipExtractor(
|
||||||
|
|
||||||
override fun getPagesList(path: Path): List<BookPage> =
|
override fun getPagesList(path: Path): List<BookPage> =
|
||||||
ZipFile(path.toFile()).use { zip ->
|
ZipFile(path.toFile()).use { zip ->
|
||||||
zip.entries().toList()
|
zip.entries.toList()
|
||||||
.filter { !it.isDirectory }
|
.filter { !it.isDirectory }
|
||||||
.map {
|
.map {
|
||||||
BookPage(
|
BookPage(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue