HeanCMS: Don't show paid chapters. (#18973)

Changes
This commit is contained in:
bapeey 2023-11-14 22:07:55 -05:00 committed by GitHub
parent aa8227e0a4
commit b332a17b22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 7 deletions

View File

@ -12,4 +12,6 @@ class PerfScan : HeanCms("Perf Scan", "https://perf-scan.fr", "fr") {
override val coverPath: String = "" override val coverPath: String = ""
override val useNewQueryEndpoint = true override val useNewQueryEndpoint = true
override val slugStrategy = SlugStrategy.ID
} }

View File

@ -405,13 +405,13 @@ abstract class HeanCms(
if (useNewQueryEndpoint) { if (useNewQueryEndpoint) {
return result.seasons.orEmpty() return result.seasons.orEmpty()
.flatMap { it.chapters.orEmpty() } .flatMap { it.chapters.orEmpty() }
.filterNot { it.price == 1 } .filter { it.price == 0 }
.map { it.toSChapter(result.slug, mangaSubDirectory, dateFormat, slugStrategy) } .map { it.toSChapter(result.slug, mangaSubDirectory, dateFormat, slugStrategy) }
.filter { it.date_upload <= currentTimestamp } .filter { it.date_upload <= currentTimestamp }
} }
return result.chapters.orEmpty() return result.chapters.orEmpty()
.filterNot { it.price == 1 } .filter { it.price == 0 }
.map { it.toSChapter(result.slug, mangaSubDirectory, dateFormat, slugStrategy) } .map { it.toSChapter(result.slug, mangaSubDirectory, dateFormat, slugStrategy) }
.filter { it.date_upload <= currentTimestamp } .filter { it.date_upload <= currentTimestamp }
.reversed() .reversed()
@ -603,7 +603,7 @@ abstract class HeanCms(
SortProperty(intl.sortByTitle, "title"), SortProperty(intl.sortByTitle, "title"),
SortProperty(intl.sortByViews, "total_views"), SortProperty(intl.sortByViews, "total_views"),
SortProperty(intl.sortByLatest, "latest"), SortProperty(intl.sortByLatest, "latest"),
SortProperty(intl.sortByRecentlyAdded, "recently_added"), SortProperty(intl.sortByCreatedAt, "created_at"),
) )
protected open fun getGenreList(): List<Genre> = emptyList() protected open fun getGenreList(): List<Genre> = emptyList()

View File

@ -9,7 +9,7 @@ class HeanCmsGenerator : ThemeSourceGenerator {
override val themeClass = "HeanCms" override val themeClass = "HeanCms"
override val baseVersionCode: Int = 18 override val baseVersionCode: Int = 19
override val sources = listOf( override val sources = listOf(
SingleLang("Glorious Scan", "https://gloriousscan.com", "pt-BR", overrideVersionCode = 17), SingleLang("Glorious Scan", "https://gloriousscan.com", "pt-BR", overrideVersionCode = 17),

View File

@ -64,10 +64,10 @@ class HeanCmsIntl(lang: String) {
else -> "Latest" else -> "Latest"
} }
val sortByRecentlyAdded: String = when (availableLang) { val sortByCreatedAt: String = when (availableLang) {
BRAZILIAN_PORTUGUESE -> "Data de criação" BRAZILIAN_PORTUGUESE -> "Data de criação"
SPANISH -> "Añadido recientemente" SPANISH -> "Fecha de creación"
else -> "Recently added" else -> "Created at"
} }
val filterWarning: String = when (availableLang) { val filterWarning: String = when (availableLang) {