From 3ad438d53fadb4766d9167fbc45937455af95ddb Mon Sep 17 00:00:00 2001 From: rouhannb Date: Sun, 2 Aug 2020 18:00:18 -0400 Subject: [PATCH] fix(metadata): recognize ComicInfo Day tag and "MA15+" rating These fields are used by comictagger. --- .../infrastructure/metadata/comicinfo/ComicInfoProvider.kt | 2 +- .../komga/infrastructure/metadata/comicinfo/dto/AgeRating.kt | 1 + .../komga/infrastructure/metadata/comicinfo/dto/ComicInfo.kt | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/komga/src/main/kotlin/org/gotson/komga/infrastructure/metadata/comicinfo/ComicInfoProvider.kt b/komga/src/main/kotlin/org/gotson/komga/infrastructure/metadata/comicinfo/ComicInfoProvider.kt index 2ac7fd44f8..67a3f7d8e0 100644 --- a/komga/src/main/kotlin/org/gotson/komga/infrastructure/metadata/comicinfo/ComicInfoProvider.kt +++ b/komga/src/main/kotlin/org/gotson/komga/infrastructure/metadata/comicinfo/ComicInfoProvider.kt @@ -30,7 +30,7 @@ class ComicInfoProvider( override fun getBookMetadataFromBook(book: Book, media: Media): BookMetadataPatch? { getComicInfo(book, media)?.let { comicInfo -> val releaseDate = comicInfo.year?.let { - LocalDate.of(comicInfo.year!!, comicInfo.month ?: 1, 1) + LocalDate.of(comicInfo.year!!, comicInfo.month ?: 1, comicInfo.day ?: 1) } val authors = mutableListOf() diff --git a/komga/src/main/kotlin/org/gotson/komga/infrastructure/metadata/comicinfo/dto/AgeRating.kt b/komga/src/main/kotlin/org/gotson/komga/infrastructure/metadata/comicinfo/dto/AgeRating.kt index 444b9eadc4..963e34bdc0 100644 --- a/komga/src/main/kotlin/org/gotson/komga/infrastructure/metadata/comicinfo/dto/AgeRating.kt +++ b/komga/src/main/kotlin/org/gotson/komga/infrastructure/metadata/comicinfo/dto/AgeRating.kt @@ -12,6 +12,7 @@ enum class AgeRating(val value: String, val ageRating: Int? = null) { KIDS_TO_ADULTS("Kids to Adults", 6), M("M", 17), MA_15("MA 15+", 15), + MA_15_NOSPACE("MA15+", 15), MATURE_17("Mature 17+", 17), PG("PG", 8), R_18("R18+", 18), diff --git a/komga/src/main/kotlin/org/gotson/komga/infrastructure/metadata/comicinfo/dto/ComicInfo.kt b/komga/src/main/kotlin/org/gotson/komga/infrastructure/metadata/comicinfo/dto/ComicInfo.kt index 98849359b7..21cd52ebd8 100644 --- a/komga/src/main/kotlin/org/gotson/komga/infrastructure/metadata/comicinfo/dto/ComicInfo.kt +++ b/komga/src/main/kotlin/org/gotson/komga/infrastructure/metadata/comicinfo/dto/ComicInfo.kt @@ -43,6 +43,9 @@ class ComicInfo { @JsonProperty(value = "Month") var month: Int? = null + @JsonProperty(value = "Day") + var day: Int? = null + @JsonProperty(value = "Writer") var writer: String? = null