mirror of
https://github.com/gotson/komga.git
synced 2025-12-23 00:44:43 +01:00
fix(komga): don't repair extension for broken EPUB files
This commit is contained in:
parent
acf080be9d
commit
f41af61c95
1 changed files with 6 additions and 0 deletions
|
|
@ -178,6 +178,12 @@ class BookConverter(
|
|||
if (!mediaTypeToExtension.keys.contains(media.mediaType))
|
||||
throw MediaUnsupportedException("${media.mediaType} cannot be repaired. Must be one of ${mediaTypeToExtension.keys}")
|
||||
|
||||
if (book.path.extension.lowercase() == "epub" && media.mediaType == MediaType.ZIP.type) {
|
||||
skippedRepairs += book.id
|
||||
logger.info("EPUB file detected as zip should not be repaired, skipping: ${book.path}")
|
||||
return
|
||||
}
|
||||
|
||||
val actualExtension = book.path.extension
|
||||
val correctExtension = mediaTypeToExtension[media.mediaType]
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue