Populate the ComicInfo Number field with chapter numbers (#9514)
* Populate the ComicInfo Number field * added negative number check
This commit is contained in:
parent
73118d4af7
commit
b8716ff6fe
@ -98,6 +98,7 @@ fun Manga.hasCustomCover(coverCache: CoverCache = Injekt.get()): Boolean {
|
|||||||
fun getComicInfo(manga: Manga, chapter: Chapter, chapterUrl: String) = ComicInfo(
|
fun getComicInfo(manga: Manga, chapter: Chapter, chapterUrl: String) = ComicInfo(
|
||||||
title = ComicInfo.Title(chapter.name),
|
title = ComicInfo.Title(chapter.name),
|
||||||
series = ComicInfo.Series(manga.title),
|
series = ComicInfo.Series(manga.title),
|
||||||
|
number = chapter.chapterNumber.takeIf { it >= 0 }?.let { ComicInfo.Number(it.toString()) },
|
||||||
web = ComicInfo.Web(chapterUrl),
|
web = ComicInfo.Web(chapterUrl),
|
||||||
summary = manga.description?.let { ComicInfo.Summary(it) },
|
summary = manga.description?.let { ComicInfo.Summary(it) },
|
||||||
writer = manga.author?.let { ComicInfo.Writer(it) },
|
writer = manga.author?.let { ComicInfo.Writer(it) },
|
||||||
|
@ -44,6 +44,7 @@ fun SManga.copyFromComicInfo(comicInfo: ComicInfo) {
|
|||||||
data class ComicInfo(
|
data class ComicInfo(
|
||||||
val title: Title?,
|
val title: Title?,
|
||||||
val series: Series?,
|
val series: Series?,
|
||||||
|
val number: Number?,
|
||||||
val summary: Summary?,
|
val summary: Summary?,
|
||||||
val writer: Writer?,
|
val writer: Writer?,
|
||||||
val penciller: Penciller?,
|
val penciller: Penciller?,
|
||||||
@ -75,6 +76,10 @@ data class ComicInfo(
|
|||||||
@XmlSerialName("Series", "", "")
|
@XmlSerialName("Series", "", "")
|
||||||
data class Series(@XmlValue(true) val value: String = "")
|
data class Series(@XmlValue(true) val value: String = "")
|
||||||
|
|
||||||
|
@Serializable
|
||||||
|
@XmlSerialName("Number", "", "")
|
||||||
|
data class Number(@XmlValue(true) val value: String = "")
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
@XmlSerialName("Summary", "", "")
|
@XmlSerialName("Summary", "", "")
|
||||||
data class Summary(@XmlValue(true) val value: String = "")
|
data class Summary(@XmlValue(true) val value: String = "")
|
||||||
|
Loading…
Reference in New Issue
Block a user