[RU]Newbie -> NewManga (#10653)
* [RU]Newbie -> NewManga * fix adult * fix nextPage
|
@ -3,10 +3,10 @@ apply plugin: 'kotlin-android'
|
||||||
apply plugin: 'kotlinx-serialization'
|
apply plugin: 'kotlinx-serialization'
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
extName = 'Newbie'
|
extName = 'NewManga(Newbie)'
|
||||||
pkgNameSuffix = 'ru.newbie'
|
pkgNameSuffix = 'ru.newbie'
|
||||||
extClass = '.Newbie'
|
extClass = '.Newbie'
|
||||||
extVersionCode = 5
|
extVersionCode = 6
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 187 KiB After Width: | Height: | Size: 52 KiB |
|
@ -38,7 +38,9 @@ import java.util.Date
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
|
|
||||||
class Newbie : HttpSource() {
|
class Newbie : HttpSource() {
|
||||||
override val name = "Newbie"
|
override val name = "NewManga(Newbie)"
|
||||||
|
|
||||||
|
override val id: Long = 8033757373676218584
|
||||||
|
|
||||||
override val baseUrl = "https://newmanga.org"
|
override val baseUrl = "https://newmanga.org"
|
||||||
|
|
||||||
|
@ -82,7 +84,7 @@ class Newbie : HttpSource() {
|
||||||
val mangas = page.items.map {
|
val mangas = page.items.map {
|
||||||
it.toSManga()
|
it.toSManga()
|
||||||
}
|
}
|
||||||
return MangasPage(mangas, mangas.size == count)
|
return MangasPage(mangas, mangas.isNotEmpty())
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun LibraryDto.toSManga(): SManga {
|
private fun LibraryDto.toSManga(): SManga {
|
||||||
|
@ -160,6 +162,12 @@ class Newbie : HttpSource() {
|
||||||
else -> type
|
else -> type
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private fun parseAge(adult: String): String {
|
||||||
|
return when (adult) {
|
||||||
|
"" -> "0+"
|
||||||
|
else -> "$adult+"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun MangaDetDto.toSManga(): SManga {
|
private fun MangaDetDto.toSManga(): SManga {
|
||||||
val ratingValue = DecimalFormat("#,###.##").format(rating * 2).replace(",", ".").toFloat()
|
val ratingValue = DecimalFormat("#,###.##").format(rating * 2).replace(",", ".").toFloat()
|
||||||
|
@ -185,7 +193,7 @@ class Newbie : HttpSource() {
|
||||||
author = o.author?.name
|
author = o.author?.name
|
||||||
artist = o.artist?.name
|
artist = o.artist?.name
|
||||||
description = o.title.ru + "\n" + ratingStar + " " + ratingValue + "\n" + Jsoup.parse(o.description).text()
|
description = o.title.ru + "\n" + ratingStar + " " + ratingValue + "\n" + Jsoup.parse(o.description).text()
|
||||||
genre = genres.joinToString { it.title.ru.capitalize() } + ", " + parseType(type) + ", " + "$adult+"
|
genre = parseType(type) + ", " + adult?.let { parseAge(it) } + ", " + genres.joinToString { it.title.ru.capitalize() }
|
||||||
status = parseStatus(o.status)
|
status = parseStatus(o.status)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|