mirror of
https://github.com/gotson/komga.git
synced 2025-12-06 08:32:25 +01:00
parent
270a50c288
commit
22c21312d2
5 changed files with 11 additions and 2 deletions
|
|
@ -36,3 +36,4 @@
|
|||
| ERR_1030 | ComicRack CBL has no Name element |
|
||||
| ERR_1031 | ComicRack CBL Book is missing series or number |
|
||||
| ERR_1032 | EPUB file has wrong media type |
|
||||
| ERR_1033 | Some entries are missing |
|
||||
|
|
|
|||
|
|
@ -764,7 +764,8 @@
|
|||
"ERR_1029": "ComicRack CBL does not contain any Book element",
|
||||
"ERR_1030": "ComicRack CBL has no Name element",
|
||||
"ERR_1031": "ComicRack CBL Book is missing series or number",
|
||||
"ERR_1032": "EPUB file has wrong media type"
|
||||
"ERR_1032": "EPUB file has wrong media type",
|
||||
"ERR_1033": "Some entries are missing"
|
||||
},
|
||||
"filter": {
|
||||
"age_rating": "age rating",
|
||||
|
|
|
|||
|
|
@ -129,6 +129,10 @@ class BookAnalyzer(
|
|||
|
||||
private fun analyzeEpub(book: Book, analyzeDimensions: Boolean): Media {
|
||||
val manifest = epubExtractor.getManifest(book.path, analyzeDimensions)
|
||||
val entriesErrorSummary = manifest.missingResources
|
||||
.map { it.fileName }
|
||||
.ifEmpty { null }
|
||||
?.joinToString(prefix = "ERR_1033 [", postfix = "]") { it }
|
||||
return Media(
|
||||
status = Media.Status.READY,
|
||||
pages = manifest.divinaPages,
|
||||
|
|
@ -142,6 +146,7 @@ class BookAnalyzer(
|
|||
isFixedLayout = manifest.isFixedLayout,
|
||||
positions = manifest.positions,
|
||||
),
|
||||
comment = entriesErrorSummary,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -69,11 +69,12 @@ class EpubExtractor(
|
|||
|
||||
fun getManifest(path: Path, analyzeDimensions: Boolean): EpubManifest =
|
||||
path.epub { epub ->
|
||||
val resources = getResources(epub)
|
||||
val (resources, missingResources) = getResources(epub).partition { it.fileSize != null }
|
||||
val isFixedLayout = isFixedLayout(epub)
|
||||
val pageCount = computePageCount(epub)
|
||||
EpubManifest(
|
||||
resources = resources,
|
||||
missingResources = missingResources,
|
||||
toc = getToc(epub),
|
||||
landmarks = getLandmarks(epub),
|
||||
pageList = getPageList(epub),
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import org.gotson.komga.domain.model.R2Locator
|
|||
|
||||
data class EpubManifest(
|
||||
val resources: List<MediaFile>,
|
||||
val missingResources: List<MediaFile>,
|
||||
val toc: List<EpubTocEntry>,
|
||||
val landmarks: List<EpubTocEntry>,
|
||||
val pageList: List<EpubTocEntry>,
|
||||
|
|
|
|||
Loading…
Reference in a new issue