App Link Updated

This commit is contained in:
tom5079
2020-06-20 14:04:46 +09:00
parent 8adc4405c5
commit 772e9daf57
3 changed files with 117 additions and 31 deletions

View File

@@ -111,14 +111,12 @@ class ReaderActivity : AppCompatActivity() {
val uri = intent.data
val lastPathSegment = uri?.lastPathSegment
if (uri != null && lastPathSegment != null) {
val nonNumber = Regex("[^-?0-9]+")
galleryID = when (uri.host) {
"hitomi.la" -> lastPathSegment.replace(nonNumber, "").toInt()
"히요비.asia" -> lastPathSegment.toInt()
"xn--9w3b15m8vo.asia" -> lastPathSegment.toInt()
"hitomi.la" ->
Regex("([0-9]+).html").find(lastPathSegment)?.groupValues?.get(1)?.toIntOrNull() ?: 0
"hiyobi.me" -> lastPathSegment.toInt()
"e-hentai.org" -> uri.pathSegments[1].toInt()
else -> return
else -> 0
}
}
} else {

View File

@@ -167,8 +167,8 @@ class Cache(context: Context) : ContextWrapper(context) {
val mirrors = preference.getString("mirrors", null)?.split('>') ?: listOf()
val sources = mapOf(
Code.HITOMI to { Log.i("PUPILD", "READER - HITOMI"); xyz.quaver.hitomi.getReader(galleryID) },
Code.HIYOBI to { Log.i("PUPILD", "READER - HIYOBI"); xyz.quaver.hiyobi.getReader(galleryID) }
Code.HITOMI to { xyz.quaver.hitomi.getReader(galleryID) },
Code.HIYOBI to { xyz.quaver.hiyobi.getReader(galleryID) }
).let {
if (mirrors.isNotEmpty())
it.toSortedMap(