fix backup file selection, support hasha link

This commit is contained in:
tom5079
2024-01-15 19:01:30 -08:00
parent 6d108dd7ff
commit 114158cf73
5 changed files with 56 additions and 120 deletions

View File

@@ -157,10 +157,11 @@ class ReaderActivity : BaseActivity() {
val uri = intent.data
val lastPathSegment = uri?.lastPathSegment
if (uri != null && lastPathSegment != null) {
galleryID = when (uri.host) {
galleryID = if (uri.host?.endsWith("hasha.in") == true) {
lastPathSegment?.toInt() ?: 0
} else when (uri.host) {
"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 -> 0
}