Fix popular not working in M+. (#13953)

This commit is contained in:
Alessandro Jean 2022-10-22 19:15:51 -03:00 committed by GitHub
parent 3c49304709
commit d5dd9308d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -6,7 +6,7 @@ ext {
extName = 'MANGA Plus by SHUEISHA'
pkgNameSuffix = 'all.mangaplus'
extClass = '.MangaPlusFactory'
extVersionCode = 38
extVersionCode = 39
}
apply from: "$rootDir/common.gradle"

View File

@ -199,7 +199,7 @@ class MangaPlus(
.filter { it.language == langCode }
.filter { title ->
title.name.contains(filter, ignoreCase = true) ||
title.author.contains(filter, ignoreCase = true)
title.author.orEmpty().contains(filter, ignoreCase = true)
}
val mangas = titleList!!.map(Title::toSManga)

View File

@ -56,7 +56,7 @@ data class WebHomeViewV3(val groups: List<UpdatedTitleV2Group> = emptyList())
data class TitleDetailView(
val title: Title,
val titleImageUrl: String,
val overview: String,
val overview: String? = null,
val backgroundImageUrl: String,
val nextTimeStamp: Int = 0,
val viewingPeriodDescription: String = "",
@ -92,7 +92,7 @@ data class TitleDetailView(
)
fun toSManga(): SManga = title.toSManga().apply {
description = overview + "\n\n" + viewingPeriodDescription
description = (overview.orEmpty() + "\n\n" + viewingPeriodDescription).trim()
status = if (isCompleted) SManga.COMPLETED else SManga.ONGOING
genre = genres.joinToString()
}
@ -114,7 +114,7 @@ data class MangaViewer(
data class Title(
val titleId: Int,
val name: String,
val author: String,
val author: String? = null,
val portraitImageUrl: String,
val landscapeImageUrl: String,
val viewCount: Int = 0,
@ -123,7 +123,7 @@ data class Title(
fun toSManga(): SManga = SManga.create().apply {
title = name
author = this@Title.author.replace(" / ", ", ")
author = this@Title.author?.replace(" / ", ", ")
artist = author
thumbnail_url = portraitImageUrl
url = "#/titles/$titleId"