mirror of
https://github.com/gotson/komga.git
synced 2025-12-16 13:33:49 +01:00
parent
5e7194c166
commit
122f0c92ad
8 changed files with 58 additions and 12 deletions
|
|
@ -15,7 +15,7 @@ data class MylarMetadata(
|
|||
val name: String,
|
||||
|
||||
@field:JsonAlias("cid")
|
||||
val comicId: String,
|
||||
val comicid: String,
|
||||
|
||||
val year: Int,
|
||||
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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<Series>(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")
|
||||
|
|
|
|||
21
komga/src/test/resources/mylar/series-gh961.json
Normal file
21
komga/src/test/resources/mylar/series-gh961.json
Normal file
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
"type": "comicSeries",
|
||||
"imprint": null,
|
||||
"name": "Usagi Yojimbo",
|
||||
"cid": 119731,
|
||||
"comicid": 119731,
|
||||
"year": 2019,
|
||||
"description_text": null,
|
||||
"description_formatted": null,
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
"publisher": "IDW Publishing",
|
||||
"imprint": null,
|
||||
"name": "Usagi Yojimbo",
|
||||
"cid": 119731,
|
||||
"comicid": 119731,
|
||||
"year": 2019,
|
||||
"description_text": null,
|
||||
"description_formatted": null,
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
"publisher": "IDW Publishing",
|
||||
"imprint": null,
|
||||
"name": "Usagi Yojimbo",
|
||||
"cid": 119731,
|
||||
"comicid": 119731,
|
||||
"description_text": null,
|
||||
"description_formatted": null,
|
||||
"volume": 4,
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
"publisher": "IDW Publishing",
|
||||
"imprint": null,
|
||||
"name": "Usagi Yojimbo",
|
||||
"comicId": 119731,
|
||||
"comicid": 119731,
|
||||
"year": 2019,
|
||||
"description_text": null,
|
||||
"description_formatted": null,
|
||||
|
|
|
|||
Loading…
Reference in a new issue