Drake Scans: Add option to hide paid chapters (#11504)
* added support for paid chapter filtering * updated extension version correctly * using config screen correctly with orginal theme class * Update src/en/drakescans/src/eu/kanade/tachiyomi/extension/en/drakescans/DrakeScans.kt --------- Co-authored-by: AwkwardPeak7 <48650614+AwkwardPeak7@users.noreply.github.com>
This commit is contained in:
parent
5578344e19
commit
809848ab33
@ -3,7 +3,7 @@ ext {
|
||||
extClass = '.DrakeScans'
|
||||
themePkg = 'mangathemesia'
|
||||
baseUrl = 'https://drakecomic.org'
|
||||
overrideVersionCode = 14
|
||||
overrideVersionCode = 15
|
||||
isNsfw = false
|
||||
}
|
||||
|
||||
|
||||
@ -1,20 +1,29 @@
|
||||
package eu.kanade.tachiyomi.extension.en.drakescans
|
||||
|
||||
import androidx.preference.PreferenceScreen
|
||||
import eu.kanade.tachiyomi.multisrc.mangathemesia.MangaThemesia
|
||||
import eu.kanade.tachiyomi.multisrc.mangathemesia.MangaThemesiaPaidChapterHelper
|
||||
import eu.kanade.tachiyomi.network.interceptor.rateLimitHost
|
||||
import eu.kanade.tachiyomi.source.ConfigurableSource
|
||||
import eu.kanade.tachiyomi.source.model.Page
|
||||
import keiyoushi.utils.getPreferencesLazy
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import okhttp3.Request
|
||||
import java.util.concurrent.TimeUnit
|
||||
import kotlin.getValue
|
||||
|
||||
class DrakeScans : MangaThemesia(
|
||||
"Drake Scans",
|
||||
"https://drakecomic.org",
|
||||
"en",
|
||||
) {
|
||||
class DrakeScans :
|
||||
MangaThemesia(
|
||||
"Drake Scans",
|
||||
"https://drakecomic.org",
|
||||
"en",
|
||||
),
|
||||
ConfigurableSource {
|
||||
// madara -> mangathemesia
|
||||
override val versionId = 2
|
||||
|
||||
private val preferences by getPreferencesLazy()
|
||||
|
||||
override val client = super.client.newBuilder()
|
||||
.rateLimitHost(baseUrl.toHttpUrl(), 3, 1, TimeUnit.SECONDS)
|
||||
.build()
|
||||
@ -29,4 +38,17 @@ class DrakeScans : MangaThemesia(
|
||||
companion object {
|
||||
val JETPACK_CDN_REGEX = """^https:\/\/i[0-9]\.wp\.com\/""".toRegex()
|
||||
}
|
||||
|
||||
private val paidChapterHelper = MangaThemesiaPaidChapterHelper(lockedChapterSelector = "ul li.locked")
|
||||
|
||||
override fun setupPreferenceScreen(screen: PreferenceScreen) {
|
||||
paidChapterHelper.addHidePaidChaptersPreferenceToScreen(screen, intl)
|
||||
}
|
||||
|
||||
override fun chapterListSelector(): String {
|
||||
return paidChapterHelper.getChapterListSelectorBasedOnHidePaidChaptersPref(
|
||||
super.chapterListSelector(),
|
||||
preferences,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user