Added Colored Council (#7533)

* Add files via upload

* Update GuyaGenerator.kt

* Update GuyaGenerator.kt
This commit is contained in:
KojoZero 2021-06-08 09:11:43 -07:00 committed by GitHub
parent 8e720b8016
commit 4c73e677ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 92 additions and 0 deletions

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="eu.kanade.tachiyomi.extension">
<application>
<activity
android:name=".en.coloredcouncil.ColoredCouncilUrlActivity"
android:excludeFromRecents="true"
android:theme="@android:style/Theme.NoDisplay">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="coloredcouncil.moe"
android:pathPattern="/read/manga/..*"
android:scheme="https" />
</intent-filter>
</activity>
</application>
</manifest>

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 KiB

View File

@ -0,0 +1,11 @@
package eu.kanade.tachiyomi.extension.en.coloredcouncil
import eu.kanade.tachiyomi.multisrc.guya.Guya
class ColoredCouncil : Guya("Colored Council", "https://coloredcouncil.moe", "en") {
companion object {
const val SLUG_PREFIX = "slug:"
const val PROXY_PREFIX = "proxy:"
const val NESTED_PROXY_API_PREFIX = "/proxy/api/"
}
}

View File

@ -0,0 +1,57 @@
package eu.kanade.tachiyomi.extension.en.coloredcouncil
import android.app.Activity
import android.content.ActivityNotFoundException
import android.content.Intent
import android.os.Bundle
import android.util.Log
import kotlin.system.exitProcess
/**
* Accepts https://danke.moe/read/manga/xyz intents
*
* Added due to requests from various users to allow for opening of titles when given the
* Guya URL whilst on mobile.
*/
class ColoredCouncilUrlActivity : Activity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val host = intent?.data?.host
val pathSegments = intent?.data?.pathSegments
if (host != null && pathSegments != null) {
val query = fromColoredCouncil(pathSegments)
if (query == null) {
Log.e("ColoredCouncilUrlActivity", "Unable to parse URI from intent $intent")
finish()
exitProcess(1)
}
val mainIntent = Intent().apply {
action = "eu.kanade.tachiyomi.SEARCH"
putExtra("query", query)
putExtra("filter", packageName)
}
try {
startActivity(mainIntent)
} catch (e: ActivityNotFoundException) {
Log.e("ColoredCouncilUrlActivity", e.toString())
}
}
finish()
exitProcess(0)
}
private fun fromColoredCouncil(pathSegments: MutableList<String>): String? {
return if (pathSegments.size >= 3) {
val slug = pathSegments[2]
"${ColoredCouncil.SLUG_PREFIX}$slug"
} else {
null
}
}
}

View File

@ -14,6 +14,7 @@ class GuyaGenerator : ThemeSourceGenerator {
override val sources = listOf(
SingleLang("Guya", "https://guya.moe", "en", overrideVersionCode = 18),
SingleLang("Danke fürs Lesen", "https://danke.moe", "en", className = "DankeFursLesen"),
SingleLang("Colored Council", "https://coloredcouncil.moe", "en"),
)
companion object {
@JvmStatic