Skip to content

Commit

Permalink
fix: comicInfo.xml SeriesGroup is now split by comma
Browse files Browse the repository at this point in the history
Closes: #1122
  • Loading branch information
gotson committed Jun 27, 2023
1 parent 99d8f3e commit cdd022f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class ComicInfoProvider(
language = if (comicInfo.languageISO != null && BCP47TagValidator.isValid(comicInfo.languageISO!!)) comicInfo.languageISO else null,
genres = if (!genres.isNullOrEmpty()) genres.toSet() else null,
totalBookCount = comicInfo.count,
collections = listOfNotNull(comicInfo.seriesGroup?.ifBlank { null }),
collections = comicInfo.seriesGroup?.split(',')?.mapNotNull { it.trim().ifBlank { null } } ?: emptyList(),
)
}
return null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ class ComicInfoProviderTest {
fun `given comicInfo when getting series metadata then metadata patch is valid`() {
val comicInfo = ComicInfo().apply {
series = "series"
seriesGroup = "collection"
seriesGroup = "multiple,collections"
publisher = "publisher"
ageRating = AgeRating.MA_15
manga = Manga.YES_AND_RIGHT_TO_LEFT
Expand All @@ -361,7 +361,7 @@ class ComicInfoProviderTest {
assertThat(title).isEqualTo("series")
assertThat(titleSort).isEqualTo("series")
assertThat(status).isNull()
assertThat(collections).containsExactly("collection")
assertThat(collections).containsExactlyInAnyOrder("collections", "multiple")
assertThat(publisher).isEqualTo("publisher")
assertThat(ageRating).isEqualTo(15)
assertThat(readingDirection).isEqualTo(SeriesMetadata.ReadingDirection.RIGHT_TO_LEFT)
Expand Down

0 comments on commit cdd022f

Please sign in to comment.