Move the paid title warning location in Bilibili. (#11747)
This commit is contained in:
parent
a4da018f9f
commit
6afdc59180
@ -6,7 +6,7 @@ ext {
|
|||||||
extName = 'BILIBILI'
|
extName = 'BILIBILI'
|
||||||
pkgNameSuffix = 'all.bilibili'
|
pkgNameSuffix = 'all.bilibili'
|
||||||
extClass = '.BilibiliFactory'
|
extClass = '.BilibiliFactory'
|
||||||
extVersionCode = 6
|
extVersionCode = 7
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
@ -98,10 +98,16 @@ abstract class Bilibili(
|
|||||||
protected open val defaultLatestSort: Int = 2
|
protected open val defaultLatestSort: Int = 2
|
||||||
|
|
||||||
protected open val hasPaidChaptersWarning: String = when (lang) {
|
protected open val hasPaidChaptersWarning: String = when (lang) {
|
||||||
"zh", "zh-Hans" -> "此漫画的付费章节已从章节列表中过滤,暂时请用网页端或官方app阅读。"
|
"zh", "zh-Hans" -> "$EMOJI_WARNING 此漫画的付费章节已从章节列表中过滤,暂时请用网页端或官方app阅读。"
|
||||||
else ->
|
else ->
|
||||||
"This series has paid chapters that were filtered out from the chapter list. " +
|
"$EMOJI_WARNING WARNING: This series has paid chapters that were filtered out from " +
|
||||||
"Use the BILIBILI website or the official app to read them for now."
|
"the chapter list. If you have already bought and have any in your account, sign " +
|
||||||
|
"in through WebView and refresh the chapter list to read them."
|
||||||
|
}
|
||||||
|
|
||||||
|
protected open val paidLabel: String = when (lang) {
|
||||||
|
"zh", "zh-Hans" -> "付费"
|
||||||
|
else -> "Paid"
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open val imageQualityPrefTitle: String = when (lang) {
|
protected open val imageQualityPrefTitle: String = when (lang) {
|
||||||
@ -347,13 +353,13 @@ abstract class Bilibili(
|
|||||||
title = comic.title
|
title = comic.title
|
||||||
author = comic.authorName.joinToString()
|
author = comic.authorName.joinToString()
|
||||||
status = if (comic.isFinish == 1) SManga.COMPLETED else SManga.ONGOING
|
status = if (comic.isFinish == 1) SManga.COMPLETED else SManga.ONGOING
|
||||||
genre = comic.styles.joinToString()
|
genre = comic.genres(paidLabel, EMOJI_LOCKED).joinToString()
|
||||||
description = comic.classicLines
|
description = comic.classicLines
|
||||||
thumbnail_url = comic.verticalCover + THUMBNAIL_RESOLUTION
|
thumbnail_url = comic.verticalCover + THUMBNAIL_RESOLUTION
|
||||||
url = "/detail/mc" + comic.id
|
url = "/detail/mc" + comic.id
|
||||||
|
|
||||||
if (comic.hasPaidChapters && !signedIn) {
|
if (comic.hasPaidChapters && !signedIn) {
|
||||||
description += "\n\n$hasPaidChaptersWarning"
|
description = "$hasPaidChaptersWarning\n\n$description"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -586,5 +592,8 @@ abstract class Bilibili(
|
|||||||
private val DATE_FORMATTER by lazy {
|
private val DATE_FORMATTER by lazy {
|
||||||
SimpleDateFormat("yyyy-MM-dd", Locale.ENGLISH)
|
SimpleDateFormat("yyyy-MM-dd", Locale.ENGLISH)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private const val EMOJI_LOCKED = "\uD83D\uDD12"
|
||||||
|
private const val EMOJI_WARNING = "\u26A0\uFE0F"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,9 @@ data class BilibiliComicDto(
|
|||||||
) {
|
) {
|
||||||
val hasPaidChapters: Boolean
|
val hasPaidChapters: Boolean
|
||||||
get() = episodeList.any { episode -> episode.payMode == 1 && episode.payGold > 0 }
|
get() = episodeList.any { episode -> episode.payMode == 1 && episode.payGold > 0 }
|
||||||
|
|
||||||
|
fun genres(paidLabel: String, emoji: String): List<String> =
|
||||||
|
(if (hasPaidChapters) listOf("$emoji $paidLabel") else emptyList()) + styles
|
||||||
}
|
}
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
|
Loading…
x
Reference in New Issue
Block a user