Migrate Guya proxy to Cubari, QoL updates to Cubari. (#6324)

* Remove Guya proxy intents.

* Cubari sourceFactory for easier discoverability, search improvements.
This commit is contained in:
funkyhippo
2021-03-28 13:20:51 -07:00
committed by GitHub
parent 39ac1f81a6
commit d604f06811
6 changed files with 26 additions and 47 deletions

View File

@ -4,8 +4,8 @@ apply plugin: 'kotlin-android'
ext {
extName = 'Cubari'
pkgNameSuffix = "all.cubari"
extClass = '.Cubari'
extVersionCode = 1
extClass = '.CubariFactory'
extVersionCode = 2
libVersion = '1.2'
}

View File

@ -17,12 +17,11 @@ import org.json.JSONArray
import org.json.JSONObject
import rx.Observable
open class Cubari : HttpSource() {
open class Cubari(override val lang: String) : HttpSource() {
final override val name = "Cubari"
final override val baseUrl = "https://cubari.moe"
final override val supportsLatest = true
final override val lang = "all"
override fun headersBuilder() = Headers.Builder().apply {
add(
@ -218,7 +217,7 @@ open class Cubari : HttpSource() {
searchMangaParse(response, trimmedQuery)
}
}
else -> Observable.just(MangasPage(ArrayList(), false))
else -> throw Exception(SEARCH_FALLBACK_MSG)
}
}
@ -230,7 +229,7 @@ open class Cubari : HttpSource() {
return GET("$baseUrl/read/api/$source/series/$slug/", headers)
} catch (e: Exception) {
throw Exception("Unable to parse. Is your query in the format of ${Cubari.PROXY_PREFIX}<source>/<slug>?")
throw Exception(SEARCH_FALLBACK_MSG)
}
}
@ -345,6 +344,8 @@ open class Cubari : HttpSource() {
const val ARTIST_FALLBACK = "Unknown"
const val DESCRIPTION_FALLBACK = "No description."
const val SEARCH_FALLBACK_MSG = "Unable to parse. Is your query in the format of $PROXY_PREFIX<source>/<slug>?"
enum class SortType {
PINNED,
UNPINNED

View File

@ -0,0 +1,12 @@
package eu.kanade.tachiyomi.extension.all.cubari
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceFactory
class CubariFactory : SourceFactory {
override fun createSources(): List<Source> = listOf(
Cubari("en"),
Cubari("all"),
Cubari("other")
)
}