mirror of
https://github.com/keiyoushi/extensions-source.git
synced 2024-11-21 18:02: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")
|
||||
}
|
||||
|
||||
baseVersionCode = 2
|
||||
baseVersionCode = 3
|
||||
|
@ -30,6 +30,7 @@ class BrowseManga(
|
||||
private val id: Int,
|
||||
private val title: String,
|
||||
private val cover: String? = null,
|
||||
@SerialName("is_novel") val isNovel: Boolean,
|
||||
) {
|
||||
fun toSManga(createThumbnail: (String, String) -> String) = SManga.create().apply {
|
||||
url = "/mangas/$id"
|
||||
@ -83,7 +84,7 @@ class Manga(
|
||||
else -> SManga.UNKNOWN
|
||||
}
|
||||
genre = buildList {
|
||||
add(type.title)
|
||||
type.title?.let { add(it) }
|
||||
add(type.name)
|
||||
categories.forEach { add(it.name) }
|
||||
}.joinToString()
|
||||
@ -123,7 +124,7 @@ class NameDto(val name: String)
|
||||
@Serializable
|
||||
class TypeDto(
|
||||
val name: String,
|
||||
val title: String,
|
||||
val title: String?,
|
||||
)
|
||||
|
||||
@Serializable
|
||||
|
@ -49,6 +49,7 @@ abstract class Gmanga(
|
||||
|
||||
override fun latestUpdatesParse(response: Response): MangasPage {
|
||||
val releases = response.parseAs<LatestChaptersDto>().releases
|
||||
.filterNot { it.manga.isNovel }
|
||||
|
||||
val entries = releases.map { it.manga.toSManga(::createThumbnail) }
|
||||
.distinctBy { it.url }
|
||||
|
Loading…
Reference in New Issue
Block a user