mirror of
https://github.com/keiyoushi/extensions-source.git
synced 2024-11-22 02:12:42 +01:00
Gmanga multisrc: filter out novel & fix null (#2303)
* Gmanga: filter out novel & fix null * avoid null string in genre * Update lib-multisrc/gmanga/src/eu/kanade/tachiyomi/multisrc/gmanga/Dto.kt
This commit is contained in:
parent
5d95700faf
commit
0a00d342ee
@ -2,4 +2,4 @@ plugins {
|
|||||||
id("lib-multisrc")
|
id("lib-multisrc")
|
||||||
}
|
}
|
||||||
|
|
||||||
baseVersionCode = 2
|
baseVersionCode = 3
|
||||||
|
@ -30,6 +30,7 @@ class BrowseManga(
|
|||||||
private val id: Int,
|
private val id: Int,
|
||||||
private val title: String,
|
private val title: String,
|
||||||
private val cover: String? = null,
|
private val cover: String? = null,
|
||||||
|
@SerialName("is_novel") val isNovel: Boolean,
|
||||||
) {
|
) {
|
||||||
fun toSManga(createThumbnail: (String, String) -> String) = SManga.create().apply {
|
fun toSManga(createThumbnail: (String, String) -> String) = SManga.create().apply {
|
||||||
url = "/mangas/$id"
|
url = "/mangas/$id"
|
||||||
@ -83,7 +84,7 @@ class Manga(
|
|||||||
else -> SManga.UNKNOWN
|
else -> SManga.UNKNOWN
|
||||||
}
|
}
|
||||||
genre = buildList {
|
genre = buildList {
|
||||||
add(type.title)
|
type.title?.let { add(it) }
|
||||||
add(type.name)
|
add(type.name)
|
||||||
categories.forEach { add(it.name) }
|
categories.forEach { add(it.name) }
|
||||||
}.joinToString()
|
}.joinToString()
|
||||||
@ -123,7 +124,7 @@ class NameDto(val name: String)
|
|||||||
@Serializable
|
@Serializable
|
||||||
class TypeDto(
|
class TypeDto(
|
||||||
val name: String,
|
val name: String,
|
||||||
val title: String,
|
val title: String?,
|
||||||
)
|
)
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
|
@ -49,6 +49,7 @@ abstract class Gmanga(
|
|||||||
|
|
||||||
override fun latestUpdatesParse(response: Response): MangasPage {
|
override fun latestUpdatesParse(response: Response): MangasPage {
|
||||||
val releases = response.parseAs<LatestChaptersDto>().releases
|
val releases = response.parseAs<LatestChaptersDto>().releases
|
||||||
|
.filterNot { it.manga.isNovel }
|
||||||
|
|
||||||
val entries = releases.map { it.manga.toSManga(::createThumbnail) }
|
val entries = releases.map { it.manga.toSManga(::createThumbnail) }
|
||||||
.distinctBy { it.url }
|
.distinctBy { it.url }
|
||||||
|
Loading…
Reference in New Issue
Block a user