Update to extensions-lib 1.4.3 (#17781)

This commit is contained in:
arkon 2023-09-02 23:23:30 -04:00 committed by GitHub
parent b06865f0c4
commit 3da0424b9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 29 additions and 28 deletions

View File

@ -307,7 +307,7 @@ a.k.a. the Browse source entry point in the app (invoked by tapping on the sourc
- The app calls `fetchPopularManga` which should return a `MangasPage` containing the first batch of found `SManga` entries.
- This method supports pagination. When user scrolls the manga list and more results must be fetched, the app calls it again with increasing `page` values (starting with `page=1`). This continues while `MangasPage.hasNextPage` is passed as `true` and `MangasPage.mangas` is not empty.
- To show the list properly, the app needs `url`, `title` and `thumbnail_url`. You **must** set them here. The rest of the fields could be filled later (refer to Manga Details below).
- You should set `thumbnail_url` if is available, if not, `fetchMangaDetails` will be **immediately** called (this will increase network calls heavily and should be avoided).
- You should set `thumbnail_url` if is available, if not, `getMangaDetails` will be **immediately** called (this will increase network calls heavily and should be avoided).
#### Latest Manga
@ -350,15 +350,15 @@ open class UriPartFilter(displayName: String, private val vals: Array<Pair<Strin
#### Manga Details
- When user taps on a manga, `fetchMangaDetails` and `fetchChapterList` will be called and the results will be cached.
- When user taps on a manga, `getMangaDetails` and `getChapterList` will be called and the results will be cached.
- A `SManga` entry is identified by it's `url`.
- `fetchMangaDetails` is called to update a manga's details from when it was initialized earlier.
- `SManga.initialized` tells the app if it should call `fetchMangaDetails`. If you are overriding `fetchMangaDetails`, make sure to pass it as `true`.
- `getMangaDetails` is called to update a manga's details from when it was initialized earlier.
- `SManga.initialized` tells the app if it should call `getMangaDetails`. If you are overriding `getMangaDetails`, make sure to pass it as `true`.
- `SManga.genre` is a string containing list of all genres separated with `", "`.
- `SManga.status` is an "enum" value. Refer to [the values in the `SManga` companion object](https://github.com/tachiyomiorg/extensions-lib/blob/master/library/src/main/java/eu/kanade/tachiyomi/source/model/SManga.kt#L24).
- During a backup, only `url` and `title` are stored. To restore the rest of the manga data, the app calls `fetchMangaDetails`, so all fields should be (re)filled in if possible.
- If a `SManga` is cached, `fetchMangaDetails` will be only called when the user does a manual update (Swipe-to-Refresh).
- `fetchChapterList` is called to display the chapter list.
- During a backup, only `url` and `title` are stored. To restore the rest of the manga data, the app calls `getMangaDetails`, so all fields should be (re)filled in if possible.
- If a `SManga` is cached, `getMangaDetails` will be only called when the user does a manual update (Swipe-to-Refresh).
- `getChapterList` is called to display the chapter list.
- **The list should be sorted descending by the source order**.
- `getMangaUrl` is called when the user taps "Open in WebView".
- If the source uses an API to fetch the data, consider overriding this method to return the manga absolute URL in the website instead.
@ -397,7 +397,7 @@ open class UriPartFilter(displayName: String, private val vals: Array<Pair<Strin
#### Chapter Pages
- When user opens a chapter, `fetchPageList` will be called and it will return a list of `Page`s.
- When user opens a chapter, `getPageList` will be called and it will return a list of `Page`s.
- While a chapter is open in the reader or is being downloaded, `fetchImageUrl` will be called to get URLs for each page of the manga if the `Page.imageUrl` is empty.
- If the source provides all the `Page.imageUrl`'s directly, you can fill them and let the `Page.url` empty, so the app will skip the `fetchImageUrl` source and call directly `fetchImage`.
- The `Page.url` and `Page.imageUrl` attributes **should be set as an absolute URL**.

View File

@ -4,12 +4,12 @@ coroutines_version = "1.6.4"
serialization_version = "1.4.0"
[libraries]
gradle-agp = { module = "com.android.tools.build:gradle", version = "7.4.1" }
gradle-agp = { module = "com.android.tools.build:gradle", version = "7.4.2" }
gradle-kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin_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.2" }
tachiyomi-lib = { module = "com.github.tachiyomiorg:extensions-lib", version = "1.4.3" }
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" }

View File

@ -2,5 +2,6 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View File

@ -6,7 +6,7 @@ ext {
extName = 'Cubari'
pkgNameSuffix = "all.cubari"
extClass = '.CubariFactory'
extVersionCode = 19
extVersionCode = 20
}
apply from: "$rootDir/common.gradle"

View File

@ -5,6 +5,7 @@ import android.os.Build
import eu.kanade.tachiyomi.AppInfo
import eu.kanade.tachiyomi.network.GET
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
@ -83,10 +84,10 @@ open class Cubari(override val lang: String) : HttpSource() {
return parseMangaList(result, SortType.PINNED)
}
override fun fetchMangaDetails(manga: SManga): Observable<SManga> {
override suspend fun getMangaDetails(manga: SManga): SManga {
return client.newCall(chapterListRequest(manga))
.asObservableSuccess()
.map { response -> mangaDetailsParse(response, manga) }
.await()
.let { response -> mangaDetailsParse(response, manga) }
}
// Called when the series is loaded, or when opening in browser
@ -103,10 +104,10 @@ open class Cubari(override val lang: String) : HttpSource() {
return parseManga(result, manga)
}
override fun fetchChapterList(manga: SManga): Observable<List<SChapter>> {
override suspend fun getChapterList(manga: SManga): List<SChapter> {
return client.newCall(chapterListRequest(manga))
.asObservableSuccess()
.map { response -> chapterListParse(response, manga) }
.await()
.let { response -> chapterListParse(response, manga) }
}
// Gets the chapter list based on the series being viewed
@ -128,19 +129,19 @@ open class Cubari(override val lang: String) : HttpSource() {
return parseChapterList(res, manga)
}
override fun fetchPageList(chapter: SChapter): Observable<List<Page>> {
override suspend fun getPageList(chapter: SChapter): List<Page> {
return when {
chapter.url.contains("/chapter/") -> {
client.newCall(pageListRequest(chapter))
.asObservableSuccess()
.map { response ->
.await()
.let { response ->
directPageListParse(response)
}
}
else -> {
client.newCall(pageListRequest(chapter))
.asObservableSuccess()
.map { response ->
.await()
.let { response ->
seriesJsonPageListParse(response, chapter)
}
}

View File

@ -6,7 +6,7 @@ ext {
extName = 'Komga'
pkgNameSuffix = 'all.komga'
extClass = '.KomgaFactory'
extVersionCode = 48
extVersionCode = 49
}
apply from: "$rootDir/common.gradle"

View File

@ -20,7 +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.asObservableSuccess
import eu.kanade.tachiyomi.network.await
import eu.kanade.tachiyomi.source.ConfigurableSource
import eu.kanade.tachiyomi.source.UnmeteredSource
import eu.kanade.tachiyomi.source.model.Filter
@ -39,7 +39,6 @@ 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
@ -180,10 +179,10 @@ open class Komga(private val suffix: String = "") : ConfigurableSource, Unmetere
override fun searchMangaParse(response: Response): MangasPage =
processSeriesPage(response)
override fun fetchMangaDetails(manga: SManga): Observable<SManga> {
override suspend fun getMangaDetails(manga: SManga): SManga {
return client.newCall(GET(manga.url, headers))
.asObservableSuccess()
.map { response ->
.await()
.let { response ->
mangaDetailsParse(response).apply { initialized = true }
}
}