From dc237650eae30c09d5a85a202b4639db974839eb Mon Sep 17 00:00:00 2001 From: arkon Date: Fri, 8 Sep 2023 22:47:27 -0400 Subject: [PATCH] Revert to extensions-lib 1.4.2 Better to just wait for 1.5 to do the RxJava migration changes together for all APIs. --- gradle/libs.versions.toml | 2 +- src/all/cubari/build.gradle | 2 +- .../tachiyomi/extension/all/cubari/Cubari.kt | 24 +++++++++---------- src/all/komga/build.gradle | 2 +- .../tachiyomi/extension/all/komga/Komga.kt | 8 ++++--- 5 files changed, 20 insertions(+), 18 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index fe69074c1..88100fa5c 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -9,7 +9,7 @@ gradle-kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version. gradle-serialization = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlin_version" } gradle-kotlinter = { module = "org.jmailen.gradle:kotlinter-gradle", version = "3.13.0" } -tachiyomi-lib = { module = "com.github.tachiyomiorg:extensions-lib", version = "1.4.3" } +tachiyomi-lib = { module = "com.github.tachiyomiorg:extensions-lib", version = "1.4.2" } kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin_version" } kotlin-protobuf = { module = "org.jetbrains.kotlinx:kotlinx-serialization-protobuf", version.ref = "serialization_version" } diff --git a/src/all/cubari/build.gradle b/src/all/cubari/build.gradle index 2bdd83399..b42771158 100644 --- a/src/all/cubari/build.gradle +++ b/src/all/cubari/build.gradle @@ -6,7 +6,7 @@ ext { extName = 'Cubari' pkgNameSuffix = "all.cubari" extClass = '.CubariFactory' - extVersionCode = 20 + extVersionCode = 21 } apply from: "$rootDir/common.gradle" diff --git a/src/all/cubari/src/eu/kanade/tachiyomi/extension/all/cubari/Cubari.kt b/src/all/cubari/src/eu/kanade/tachiyomi/extension/all/cubari/Cubari.kt index b604b9d3d..c1103f386 100644 --- a/src/all/cubari/src/eu/kanade/tachiyomi/extension/all/cubari/Cubari.kt +++ b/src/all/cubari/src/eu/kanade/tachiyomi/extension/all/cubari/Cubari.kt @@ -4,8 +4,8 @@ import android.app.Application import android.os.Build import eu.kanade.tachiyomi.AppInfo import eu.kanade.tachiyomi.network.GET +import eu.kanade.tachiyomi.network.asObservable import eu.kanade.tachiyomi.network.asObservableSuccess -import eu.kanade.tachiyomi.network.await import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.MangasPage import eu.kanade.tachiyomi.source.model.Page @@ -84,10 +84,10 @@ open class Cubari(override val lang: String) : HttpSource() { return parseMangaList(result, SortType.PINNED) } - override suspend fun getMangaDetails(manga: SManga): SManga { + override fun fetchMangaDetails(manga: SManga): Observable { return client.newCall(chapterListRequest(manga)) - .await() - .let { response -> mangaDetailsParse(response, manga) } + .asObservableSuccess() + .map { response -> mangaDetailsParse(response, manga) } } // Called when the series is loaded, or when opening in browser @@ -104,10 +104,10 @@ open class Cubari(override val lang: String) : HttpSource() { return parseManga(result, manga) } - override suspend fun getChapterList(manga: SManga): List { + override fun fetchChapterList(manga: SManga): Observable> { return client.newCall(chapterListRequest(manga)) - .await() - .let { response -> chapterListParse(response, manga) } + .asObservable() + .map { response -> chapterListParse(response, manga) } } // Gets the chapter list based on the series being viewed @@ -129,19 +129,19 @@ open class Cubari(override val lang: String) : HttpSource() { return parseChapterList(res, manga) } - override suspend fun getPageList(chapter: SChapter): List { + override fun fetchPageList(chapter: SChapter): Observable> { return when { chapter.url.contains("/chapter/") -> { client.newCall(pageListRequest(chapter)) - .await() - .let { response -> + .asObservableSuccess() + .map { response -> directPageListParse(response) } } else -> { client.newCall(pageListRequest(chapter)) - .await() - .let { response -> + .asObservableSuccess() + .map { response -> seriesJsonPageListParse(response, chapter) } } diff --git a/src/all/komga/build.gradle b/src/all/komga/build.gradle index d8f703466..c603e6699 100644 --- a/src/all/komga/build.gradle +++ b/src/all/komga/build.gradle @@ -6,7 +6,7 @@ ext { extName = 'Komga' pkgNameSuffix = 'all.komga' extClass = '.KomgaFactory' - extVersionCode = 49 + extVersionCode = 50 } apply from: "$rootDir/common.gradle" diff --git a/src/all/komga/src/eu/kanade/tachiyomi/extension/all/komga/Komga.kt b/src/all/komga/src/eu/kanade/tachiyomi/extension/all/komga/Komga.kt index 970e47d0b..4f0adb59f 100644 --- a/src/all/komga/src/eu/kanade/tachiyomi/extension/all/komga/Komga.kt +++ b/src/all/komga/src/eu/kanade/tachiyomi/extension/all/komga/Komga.kt @@ -20,6 +20,7 @@ import eu.kanade.tachiyomi.extension.all.komga.dto.PageWrapperDto import eu.kanade.tachiyomi.extension.all.komga.dto.ReadListDto import eu.kanade.tachiyomi.extension.all.komga.dto.SeriesDto import eu.kanade.tachiyomi.network.GET +import eu.kanade.tachiyomi.network.asObservable import eu.kanade.tachiyomi.network.await import eu.kanade.tachiyomi.source.ConfigurableSource import eu.kanade.tachiyomi.source.UnmeteredSource @@ -39,6 +40,7 @@ import okhttp3.HttpUrl.Companion.toHttpUrlOrNull import okhttp3.OkHttpClient import okhttp3.Request import okhttp3.Response +import rx.Observable import rx.Single import rx.schedulers.Schedulers import uy.kohesive.injekt.Injekt @@ -179,10 +181,10 @@ open class Komga(private val suffix: String = "") : ConfigurableSource, Unmetere override fun searchMangaParse(response: Response): MangasPage = processSeriesPage(response) - override suspend fun getMangaDetails(manga: SManga): SManga { + override fun fetchMangaDetails(manga: SManga): Observable { return client.newCall(GET(manga.url, headers)) - .await() - .let { response -> + .asObservable() + .map { response -> mangaDetailsParse(response).apply { initialized = true } } }