ReaderFront: add Scylla Scans (#9750)
This commit is contained in:
parent
65a2d4eeb0
commit
4cd3753393
Binary file not shown.
After Width: | Height: | Size: 8.4 KiB |
Binary file not shown.
After Width: | Height: | Size: 4.0 KiB |
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
Binary file not shown.
After Width: | Height: | Size: 26 KiB |
Binary file not shown.
After Width: | Height: | Size: 43 KiB |
Binary file not shown.
After Width: | Height: | Size: 234 KiB |
|
@ -0,0 +1,9 @@
|
|||
package eu.kanade.tachiyomi.extension.en.scyllascans
|
||||
|
||||
import eu.kanade.tachiyomi.multisrc.readerfront.ReaderFront
|
||||
|
||||
class ScyllaScans : ReaderFront("Scylla Scans", "https://scyllascans.org/", "en", 2) {
|
||||
override fun getImageCDN(path: String, width: Int) =
|
||||
"https://i${(0..2).random()}.wp.com/api.scyllascans.org" +
|
||||
"$path?strip=all&quality=100&w=$width"
|
||||
}
|
|
@ -16,7 +16,6 @@ import kotlinx.serialization.json.jsonObject
|
|||
import kotlinx.serialization.json.jsonPrimitive
|
||||
import okhttp3.Response
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
import java.util.Locale
|
||||
|
||||
abstract class ReaderFront(
|
||||
override val name: String,
|
||||
|
@ -73,7 +72,7 @@ abstract class ReaderFront(
|
|||
append(it.demographic_name!!)
|
||||
if (it.genres!!.isNotEmpty()) {
|
||||
append(", ")
|
||||
it.genres.joinTo(this, transform = ::capitalize)
|
||||
it.genres.joinTo(this) { it.genre }
|
||||
}
|
||||
append(", ")
|
||||
append(it.type!!)
|
||||
|
@ -117,9 +116,6 @@ abstract class ReaderFront(
|
|||
}
|
||||
}!!
|
||||
|
||||
private fun capitalize(name: Name) =
|
||||
name.split('_').joinToString(" ") { it.capitalize(Locale(lang)) }
|
||||
|
||||
private inline fun <reified T> Response.parse(name: String) =
|
||||
json.parseToJsonElement(body!!.string()).jsonObject.run {
|
||||
if (containsKey("errors")) {
|
||||
|
|
|
@ -84,6 +84,9 @@ data class People(val role: Int, private val people: Name) {
|
|||
}
|
||||
|
||||
@Serializable
|
||||
data class Name(private val name: String) : CharSequence by name {
|
||||
data class Name(private val name: String) {
|
||||
val genre: String // TODO: replace with a localized genre map
|
||||
get() = name.split('_').joinToString(" ") { it.capitalize(Locale.ROOT) }
|
||||
|
||||
override fun toString() = name
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package eu.kanade.tachiyomi.multisrc.readerfront
|
||||
|
||||
import generator.ThemeSourceData.MultiLang
|
||||
import generator.ThemeSourceData.SingleLang
|
||||
import generator.ThemeSourceGenerator
|
||||
|
||||
class ReaderFrontGenerator : ThemeSourceGenerator {
|
||||
|
@ -12,6 +13,7 @@ class ReaderFrontGenerator : ThemeSourceGenerator {
|
|||
|
||||
override val sources = listOf(
|
||||
MultiLang("Ravens Scans", "https://ravens-scans.com/", listOf("es", "en"), true),
|
||||
SingleLang("Scylla Scans", "https://scyllascans.org/", "en"),
|
||||
)
|
||||
|
||||
companion object {
|
||||
|
|
Loading…
Reference in New Issue