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
							
								
									340edf19dc
								
							
						
					
					
						commit
						b2a8c207f7
					
				@ -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…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user