From e6b211f52084e5a20e5429a3ba634e759508496b Mon Sep 17 00:00:00 2001 From: Secozzi Date: Mon, 11 Mar 2024 10:53:14 +0100 Subject: [PATCH] feat(multisrc/zorotheme): force clear outdated hosts --- lib-multisrc/zorotheme/build.gradle.kts | 2 +- .../tachiyomi/multisrc/zorotheme/ZoroTheme.kt | 23 +++++++++++++++---- .../animeextension/en/kaido/Kaido.kt | 7 +++--- .../animeextension/en/zoro/HiAnime.kt | 11 ++++----- 4 files changed, 27 insertions(+), 16 deletions(-) diff --git a/lib-multisrc/zorotheme/build.gradle.kts b/lib-multisrc/zorotheme/build.gradle.kts index 986a514d96..a5b25fc7fc 100644 --- a/lib-multisrc/zorotheme/build.gradle.kts +++ b/lib-multisrc/zorotheme/build.gradle.kts @@ -2,7 +2,7 @@ plugins { id("lib-multisrc") } -baseVersionCode = 1 +baseVersionCode = 2 dependencies { api(project(":lib:megacloud-extractor")) diff --git a/lib-multisrc/zorotheme/src/eu/kanade/tachiyomi/multisrc/zorotheme/ZoroTheme.kt b/lib-multisrc/zorotheme/src/eu/kanade/tachiyomi/multisrc/zorotheme/ZoroTheme.kt index 4fe14db2a3..4d66cf113b 100644 --- a/lib-multisrc/zorotheme/src/eu/kanade/tachiyomi/multisrc/zorotheme/ZoroTheme.kt +++ b/lib-multisrc/zorotheme/src/eu/kanade/tachiyomi/multisrc/zorotheme/ZoroTheme.kt @@ -36,6 +36,7 @@ abstract class ZoroTheme( override val lang: String, override val name: String, override val baseUrl: String, + private val hosterNames: List, ) : ConfigurableAnimeSource, ParsedAnimeHttpSource() { override val supportsLatest = true @@ -44,6 +45,7 @@ abstract class ZoroTheme( val preferences: SharedPreferences by lazy { Injekt.get().getSharedPreferences("source_$id", 0x0000) + .clearOldHosts() } private val docHeaders = headers.newBuilder().apply { @@ -54,8 +56,6 @@ abstract class ZoroTheme( protected open val ajaxRoute = "" - abstract val hosterNames: List - private val useEnglish by lazy { preferences.getTitleLang == "English" } private val markFiller by lazy { preferences.markFiller } @@ -238,9 +238,7 @@ abstract class ZoroTheme( return embedLinks.parallelCatchingFlatMap(::extractVideo) } - protected open fun extractVideo(server: VideoData): List