Fix chapternumber x.x.x format (#5536)

This commit is contained in:
Eugene 2021-01-24 19:28:34 +05:00 committed by GitHub
parent f85a84d5fe
commit 221cda7694
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 5 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'Remanga'
pkgNameSuffix = 'ru.remanga'
extClass = '.Remanga'
extVersionCode = 14
extVersionCode = 15
libVersion = '1.2'
}

View File

@ -294,8 +294,7 @@ class Remanga : ConfigurableSource, HttpSource() {
@SuppressLint("DefaultLocale")
private fun chapterName(book: BookDto): String {
val chapterId: Any = if (book.chapter % 1 == 0f) book.chapter.toInt() else book.chapter
var chapterName = "${book.tome}. Глава $chapterId"
var chapterName = "${book.tome}. Глава ${book.chapter}"
if (book.name.isNotBlank()) {
chapterName += " ${book.name.capitalize()}"
}
@ -306,7 +305,7 @@ class Remanga : ConfigurableSource, HttpSource() {
val chapters = gson.fromJson<PageWrapperDto<BookDto>>(response.body()?.charStream()!!)
return chapters.content.filter { !it.is_paid or it.is_bought }.map { chapter ->
SChapter.create().apply {
chapter_number = chapter.chapter
chapter_number = 1F
name = chapterName(chapter)
url = "/api/titles/chapters/${chapter.id}"
date_upload = parseDate(chapter.upload_date)

View File

@ -70,7 +70,7 @@ data class PublisherDto(
data class BookDto(
val id: Long,
val tome: Int,
val chapter: Float,
val chapter: String,
val name: String,
val upload_date: String,
val is_paid: Boolean,