Populate the ComicInfo Number field with chapter numbers (#9514)

* Populate the ComicInfo Number field

* added negative number check
This commit is contained in:
Shamicen
2023-05-20 16:24:10 +02:00
committed by GitHub
parent 73118d4af7
commit b8716ff6fe
2 changed files with 6 additions and 0 deletions

View File

@ -98,6 +98,7 @@ fun Manga.hasCustomCover(coverCache: CoverCache = Injekt.get()): Boolean {
fun getComicInfo(manga: Manga, chapter: Chapter, chapterUrl: String) = ComicInfo(
title = ComicInfo.Title(chapter.name),
series = ComicInfo.Series(manga.title),
number = chapter.chapterNumber.takeIf { it >= 0 }?.let { ComicInfo.Number(it.toString()) },
web = ComicInfo.Web(chapterUrl),
summary = manga.description?.let { ComicInfo.Summary(it) },
writer = manga.author?.let { ComicInfo.Writer(it) },