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:
@ -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'
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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")
|
||||
)
|
||||
}
|
Reference in New Issue
Block a user