Fix chapter names to match the extension

This commit is contained in:
Jobobby04 2021-05-09 19:19:20 -04:00
parent 93fe927de2
commit 09802c3609

View File

@ -258,7 +258,6 @@ class ApiMangaParser(val client: OkHttpClient, private val lang: String) {
networkChapter: ChapterResponse, networkChapter: ChapterResponse,
groups: Map<String, String>, groups: Map<String, String>,
): ChapterInfo { ): ChapterInfo {
val chapter = SChapter.create()
val attributes = networkChapter.data.attributes val attributes = networkChapter.data.attributes
val key = MdUtil.chapterSuffix + networkChapter.data.id val key = MdUtil.chapterSuffix + networkChapter.data.id
val chapterName = StringBuilder() val chapterName = StringBuilder()
@ -272,20 +271,16 @@ class ApiMangaParser(val client: OkHttpClient, private val lang: String) {
} }
if (attributes.chapter.isNullOrBlank().not()) { if (attributes.chapter.isNullOrBlank().not()) {
if (chapterName.isNotEmpty()) {
chapterName.appends("-")
}
val chp = "Ch.${attributes.chapter}" val chp = "Ch.${attributes.chapter}"
chapterName.appends(chp) chapterName.appends(chp)
// chapter.chapter_txt = chp // chapter.chapter_txt = chp
} }
if (attributes.title.isNullOrBlank().not()) { if (!attributes.title.isNullOrBlank()) {
if (chapterName.isNotEmpty()) { if (chapterName.isNotEmpty()) {
chapterName.appends("-") chapterName.appends("-")
} }
chapterName.append(attributes.title!!) chapterName.append(attributes.title)
chapter.name = MdUtil.cleanString(attributes.title)
} }
// if volume, chapter and title is empty its a oneshot // if volume, chapter and title is empty its a oneshot