diff --git a/komga/src/main/kotlin/org/gotson/komga/infrastructure/metadata/mylar/dto/MylarMetadata.kt b/komga/src/main/kotlin/org/gotson/komga/infrastructure/metadata/mylar/dto/MylarMetadata.kt index ac0ea7a77..435842a20 100644 --- a/komga/src/main/kotlin/org/gotson/komga/infrastructure/metadata/mylar/dto/MylarMetadata.kt +++ b/komga/src/main/kotlin/org/gotson/komga/infrastructure/metadata/mylar/dto/MylarMetadata.kt @@ -15,7 +15,7 @@ data class MylarMetadata( val name: String, @field:JsonAlias("cid") - val comicId: String, + val comicid: String, val year: Int, diff --git a/komga/src/test/kotlin/org/gotson/komga/infrastructure/metadata/mylar/MylarSeriesProviderTest.kt b/komga/src/test/kotlin/org/gotson/komga/infrastructure/metadata/mylar/MylarSeriesProviderTest.kt index 283615815..8f111c36a 100644 --- a/komga/src/test/kotlin/org/gotson/komga/infrastructure/metadata/mylar/MylarSeriesProviderTest.kt +++ b/komga/src/test/kotlin/org/gotson/komga/infrastructure/metadata/mylar/MylarSeriesProviderTest.kt @@ -29,7 +29,7 @@ class MylarSeriesProviderTest { publisher = "DC", imprint = "Vertigo", name = "Sandman", - comicId = "12345", + comicid = "12345", year = 1990, descriptionText = "Sandman comics", descriptionFormatted = "Sandman comics formatted", @@ -69,7 +69,7 @@ class MylarSeriesProviderTest { publisher = "DC", imprint = "Vertigo", name = "Sandman", - comicId = "12345", + comicid = "12345", year = 1990, descriptionText = "Sandman comics", descriptionFormatted = null, @@ -109,7 +109,7 @@ class MylarSeriesProviderTest { publisher = "DC", imprint = "Vertigo", name = "Sandman", - comicId = "12345", + comicid = "12345", year = 1990, descriptionText = "Sandman comics", descriptionFormatted = "Sandman comics formatted", @@ -140,7 +140,7 @@ class MylarSeriesProviderTest { publisher = "DC", imprint = "Vertigo", name = "Sandman", - comicId = "12345", + comicid = "12345", year = 1990, descriptionText = "Sandman comics", descriptionFormatted = "Sandman comics formatted", @@ -171,7 +171,7 @@ class MylarSeriesProviderTest { publisher = "DC", imprint = "Vertigo", name = "Sandman", - comicId = "12345", + comicid = "12345", year = 1990, descriptionText = "Sandman comics", descriptionFormatted = "Sandman comics formatted", diff --git a/komga/src/test/kotlin/org/gotson/komga/infrastructure/metadata/mylar/dto/SeriesTest.kt b/komga/src/test/kotlin/org/gotson/komga/infrastructure/metadata/mylar/dto/SeriesTest.kt index 01fcd4500..0d67e25c9 100644 --- a/komga/src/test/kotlin/org/gotson/komga/infrastructure/metadata/mylar/dto/SeriesTest.kt +++ b/komga/src/test/kotlin/org/gotson/komga/infrastructure/metadata/mylar/dto/SeriesTest.kt @@ -30,7 +30,7 @@ class SeriesTest( assertThat(publisher).isEqualTo("DC Comics") assertThat(imprint).isNull() assertThat(name).isEqualTo("American Vampire 1976") - assertThat(comicId).isEqualTo("130865") + assertThat(comicid).isEqualTo("130865") assertThat(year).isEqualTo(2020) assertThat(descriptionText).isEqualTo("Nine issue mini-series, the closing chapter of American Vampire") assertThat(descriptionFormatted).isEqualTo("Nine issue mini-series, the closing chapter of American Vampire") @@ -55,7 +55,7 @@ class SeriesTest( assertThat(publisher).isEqualTo("IDW Publishing") assertThat(imprint).isNull() assertThat(name).isEqualTo("Usagi Yojimbo") - assertThat(comicId).isEqualTo("119731") + assertThat(comicid).isEqualTo("119731") assertThat(year).isEqualTo(2019) assertThat(descriptionText).isNull() assertThat(descriptionFormatted).isNull() @@ -69,6 +69,31 @@ class SeriesTest( } } + @Test + fun `given yet another valid json file when deserializing then properties are available`() { + val file = ClassPathResource("mylar/series-gh961.json") + val seriesJson = mapper.readValue(file.url) + + assertThat(seriesJson.metadata).isNotNull + with(seriesJson.metadata) { + assertThat(type).isEqualTo("comicSeries") + assertThat(publisher).isEqualTo("Kodansha Comics USA") + assertThat(imprint).isNull() + assertThat(name).isEqualTo("Vinland Saga") + assertThat(comicid).isEqualTo("69157") + assertThat(year).isEqualTo(2013) + assertThat(descriptionText).isEqualTo("English translation of Vinland Saga (ヴィンランド・サガ).Vinland Saga is the first series from Kodansha Comics USA to be released in hardcovers, each collection collects and translates two volumes of the original Japanese manga") + assertThat(descriptionFormatted).isEqualTo("English translation of Vinland Saga (ヴィンランド・サガ).Vinland Saga is the first series from Kodansha Comics USA to be released in hardcovers, each collection collects and translates two volumes of the original Japanese manga") + assertThat(volume).isNull() + assertThat(bookType).isEqualTo("Print") + assertThat(ageRating).isNull() + assertThat(comicImage).isEqualTo("https://comicvine.gamespot.com/a/uploads/scale_large/6/67663/3439178-01.jpg") + assertThat(totalIssues).isEqualTo(12) + assertThat(publicationRun).isEqualTo("November 2013 - December 2021") + assertThat(status).isEqualTo(Status.Ended) + } + } + @Test fun `given invalid json file missing year when deserializing then it fails`() { val file = ClassPathResource("mylar/series-missing-year.json") diff --git a/komga/src/test/resources/mylar/series-gh961.json b/komga/src/test/resources/mylar/series-gh961.json new file mode 100644 index 000000000..aa39e70b3 --- /dev/null +++ b/komga/src/test/resources/mylar/series-gh961.json @@ -0,0 +1,21 @@ +{ + "version": "1.0.1", + "metadata": { + "type": "comicSeries", + "publisher": "Kodansha Comics USA", + "imprint": null, + "name": "Vinland Saga", + "comicid": 69157, + "year": 2013, + "description_text": "English translation of Vinland Saga (ヴィンランド・サガ).Vinland Saga is the first series from Kodansha Comics USA to be released in hardcovers, each collection collects and translates two volumes of the original Japanese manga", + "description_formatted": "English translation of Vinland Saga (ヴィンランド・サガ).Vinland Saga is the first series from Kodansha Comics USA to be released in hardcovers, each collection collects and translates two volumes of the original Japanese manga", + "volume": null, + "booktype": "Print", + "age_rating": null, + "collects": null, + "ComicImage": "https://comicvine.gamespot.com/a/uploads/scale_large/6/67663/3439178-01.jpg", + "total_issues": 12, + "publication_run": "November 2013 - December 2021", + "status": "Ended" + } +} diff --git a/komga/src/test/resources/mylar/series-missing-publisher.json b/komga/src/test/resources/mylar/series-missing-publisher.json index 2c951ecfa..2f0883368 100755 --- a/komga/src/test/resources/mylar/series-missing-publisher.json +++ b/komga/src/test/resources/mylar/series-missing-publisher.json @@ -4,7 +4,7 @@ "type": "comicSeries", "imprint": null, "name": "Usagi Yojimbo", - "cid": 119731, + "comicid": 119731, "year": 2019, "description_text": null, "description_formatted": null, diff --git a/komga/src/test/resources/mylar/series-missing-status.json b/komga/src/test/resources/mylar/series-missing-status.json index a1559fa13..b483fe56a 100755 --- a/komga/src/test/resources/mylar/series-missing-status.json +++ b/komga/src/test/resources/mylar/series-missing-status.json @@ -5,7 +5,7 @@ "publisher": "IDW Publishing", "imprint": null, "name": "Usagi Yojimbo", - "cid": 119731, + "comicid": 119731, "year": 2019, "description_text": null, "description_formatted": null, diff --git a/komga/src/test/resources/mylar/series-missing-year.json b/komga/src/test/resources/mylar/series-missing-year.json index 3484f04f8..e107ed2ca 100755 --- a/komga/src/test/resources/mylar/series-missing-year.json +++ b/komga/src/test/resources/mylar/series-missing-year.json @@ -5,7 +5,7 @@ "publisher": "IDW Publishing", "imprint": null, "name": "Usagi Yojimbo", - "cid": 119731, + "comicid": 119731, "description_text": null, "description_formatted": null, "volume": 4, diff --git a/komga/src/test/resources/mylar/series1.json b/komga/src/test/resources/mylar/series1.json index a171617ab..321dedcbc 100755 --- a/komga/src/test/resources/mylar/series1.json +++ b/komga/src/test/resources/mylar/series1.json @@ -5,7 +5,7 @@ "publisher": "IDW Publishing", "imprint": null, "name": "Usagi Yojimbo", - "comicId": 119731, + "comicid": 119731, "year": 2019, "description_text": null, "description_formatted": null,