diff --git a/multisrc/overrides/readerfront/ravensscans/src/RavensScansFactory.kt b/multisrc/overrides/readerfront/ravensscans/src/RavensScansFactory.kt index 27c54d5ff..49616e93a 100644 --- a/multisrc/overrides/readerfront/ravensscans/src/RavensScansFactory.kt +++ b/multisrc/overrides/readerfront/ravensscans/src/RavensScansFactory.kt @@ -9,7 +9,7 @@ class RavensScansFactory : SourceFactory { RavensScans("en", 2) ) - class RavensScans(override val lang: String, override val langId: Int) : + class RavensScans(override val lang: String, override val langId: Int) : ReaderFront("Ravens Scans", "https://ravens-scans.com/", lang, langId) { override fun getImageCDN(path: String, width: Int) = "https://i${(0..2).random()}.wp.com/img-cdn1.ravens-scans.com" + diff --git a/multisrc/overrides/readerfront/scyllascans/res/mipmap-hdpi/ic_launcher.png b/multisrc/overrides/readerfront/scyllascans/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 000000000..b2f4f1360 Binary files /dev/null and b/multisrc/overrides/readerfront/scyllascans/res/mipmap-hdpi/ic_launcher.png differ diff --git a/multisrc/overrides/readerfront/scyllascans/res/mipmap-mdpi/ic_launcher.png b/multisrc/overrides/readerfront/scyllascans/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 000000000..72e5572e4 Binary files /dev/null and b/multisrc/overrides/readerfront/scyllascans/res/mipmap-mdpi/ic_launcher.png differ diff --git a/multisrc/overrides/readerfront/scyllascans/res/mipmap-xhdpi/ic_launcher.png b/multisrc/overrides/readerfront/scyllascans/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 000000000..650a2ee98 Binary files /dev/null and b/multisrc/overrides/readerfront/scyllascans/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/multisrc/overrides/readerfront/scyllascans/res/mipmap-xxhdpi/ic_launcher.png b/multisrc/overrides/readerfront/scyllascans/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 000000000..63f44b47f Binary files /dev/null and b/multisrc/overrides/readerfront/scyllascans/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/multisrc/overrides/readerfront/scyllascans/res/mipmap-xxxhdpi/ic_launcher.png b/multisrc/overrides/readerfront/scyllascans/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 000000000..8cc9e0a77 Binary files /dev/null and b/multisrc/overrides/readerfront/scyllascans/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/multisrc/overrides/readerfront/scyllascans/res/web_hi_res_512.png b/multisrc/overrides/readerfront/scyllascans/res/web_hi_res_512.png new file mode 100644 index 000000000..e12b54f77 Binary files /dev/null and b/multisrc/overrides/readerfront/scyllascans/res/web_hi_res_512.png differ diff --git a/multisrc/overrides/readerfront/scyllascans/src/ScyllaScans.kt b/multisrc/overrides/readerfront/scyllascans/src/ScyllaScans.kt new file mode 100644 index 000000000..23412e8ba --- /dev/null +++ b/multisrc/overrides/readerfront/scyllascans/src/ScyllaScans.kt @@ -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" +} diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/readerfront/ReaderFront.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/readerfront/ReaderFront.kt index d067685e3..dd745b607 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/readerfront/ReaderFront.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/readerfront/ReaderFront.kt @@ -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 Response.parse(name: String) = json.parseToJsonElement(body!!.string()).jsonObject.run { if (containsKey("errors")) { diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/readerfront/ReaderFrontAPI.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/readerfront/ReaderFrontAPI.kt index 1c124c1e3..585897640 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/readerfront/ReaderFrontAPI.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/readerfront/ReaderFrontAPI.kt @@ -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 } diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/readerfront/ReaderFrontGenerator.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/readerfront/ReaderFrontGenerator.kt index d7421035f..ea6330ba3 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/readerfront/ReaderFrontGenerator.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/readerfront/ReaderFrontGenerator.kt @@ -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 {