diff --git a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/WebPubGenerator.kt b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/WebPubGenerator.kt index c39c2d85c..9b4ecb828 100644 --- a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/WebPubGenerator.kt +++ b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/WebPubGenerator.kt @@ -136,7 +136,14 @@ class WebPubGenerator( return bookDto.toBasePublicationDto().let { publication -> publication.copy( mediaType = MEDIATYPE_WEBPUB_JSON, - metadata = publication.metadata.withSeriesMetadata(seriesMetadata).copy(conformsTo = PROFILE_EPUB), + metadata = publication.metadata.withSeriesMetadata(seriesMetadata).copy( + conformsTo = PROFILE_EPUB, + rendition = when (extension?.isFixedLayout) { + true -> mapOf("layout" to "fixed") + false -> mapOf("layout" to "reflowable") + else -> emptyMap() + }, + ), readingOrder = media.files.filter { it.subType == MediaFile.SubType.EPUB_PAGE }.map { WPLinkDto( href = uriBuilder.cloneBuilder().path("books/${bookDto.id}/resource/").path(it.fileName).toUriString(), @@ -152,11 +159,6 @@ class WebPubGenerator( toc = extension?.toc?.map { it.toWPLinkDto(uriBuilder.cloneBuilder().path("books/${bookDto.id}/resource/")) } ?: emptyList(), landmarks = extension?.landmarks?.map { it.toWPLinkDto(uriBuilder.cloneBuilder().path("books/${bookDto.id}/resource/")) } ?: emptyList(), pageList = extension?.pageList?.map { it.toWPLinkDto(uriBuilder.cloneBuilder().path("books/${bookDto.id}/resource/")) } ?: emptyList(), - layout = when (extension?.isFixedLayout) { - true -> "fixed" - false -> "reflowable" - else -> null - }, ) } } diff --git a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/dto/WepPub.kt b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/dto/WepPub.kt index 8932cf517..033c9cf5b 100644 --- a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/dto/WepPub.kt +++ b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/dto/WepPub.kt @@ -39,7 +39,6 @@ data class WPPublicationDto( val toc: List = emptyList(), val landmarks: List = emptyList(), val pageList: List = emptyList(), - val layout: String? = null, ) @JsonInclude(JsonInclude.Include.NON_EMPTY) @@ -71,6 +70,8 @@ data class WPMetadataDto( @Positive val numberOfPages: Int? = null, val belongsTo: WPBelongsToDto? = null, + // epub specific fields + val rendition: Map = emptyMap(), ) @JsonInclude(JsonInclude.Include.NON_EMPTY)