omega scans: filter patreon chapters (#16609)

This commit is contained in:
AwkwardPeak7 2023-05-30 19:48:43 +05:00 committed by GitHub
parent 5729fb1667
commit 78b9147c35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 2 deletions

View File

@ -220,7 +220,7 @@ abstract class HeanCms(
val seriesDetails = seriesSlugMap?.get(seriesSlug)
val currentSlug = seriesDetails?.slug ?: seriesSlug
val currentStatus = seriesDetails?.status ?: SManga.UNKNOWN
val currentStatus = seriesDetails?.status ?: manga.status
val apiHeaders = headersBuilder()
.add("Accept", ACCEPT_JSON)
@ -248,6 +248,7 @@ abstract class HeanCms(
val currentTimestamp = System.currentTimeMillis()
return result.chapters.orEmpty()
.filterNot { it.price == 1 }
.map { it.toSChapter(seriesSlug, dateFormat) }
.filter { it.date_upload <= currentTimestamp }
.reversed()

View File

@ -91,6 +91,7 @@ data class HeanCmsChapterDto(
@SerialName("chapter_slug") val slug: String,
val index: String,
@SerialName("created_at") val createdAt: String,
val price: Int? = null,
) {
fun toSChapter(seriesSlug: String, dateFormat: SimpleDateFormat): SChapter = SChapter.create().apply {

View File

@ -12,7 +12,7 @@ class HeanCmsGenerator : ThemeSourceGenerator {
override val baseVersionCode: Int = 13
override val sources = listOf(
SingleLang("Omega Scans", "https://omegascans.org", "en", isNsfw = true, overrideVersionCode = 16),
SingleLang("Omega Scans", "https://omegascans.org", "en", isNsfw = true, overrideVersionCode = 17),
SingleLang("Reaper Scans", "https://reaperscans.net", "pt-BR", overrideVersionCode = 35),
SingleLang("YugenMangas", "https://yugenmangas.com", "es", isNsfw = true, overrideVersionCode = 1),
)