Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
573e62f310 | ||
|
|
f9af670b82 | ||
|
|
bf461475c6 | ||
|
|
bdea6e0cc1 | ||
|
|
57f0ec4e5d |
@@ -2,7 +2,7 @@
|
||||
*Pupil, Hitomi.la viewer for Android*
|
||||
|
||||

|
||||
[](https://github.com/tom5079/Pupil/releases/download/5.3.4/Pupil-v5.3.4.apk)
|
||||
[](https://github.com/tom5079/Pupil/releases/download/5.3.6/Pupil-v5.3.6.apk)
|
||||
[](https://discord.gg/Stj4b5v)
|
||||
|
||||
# Features
|
||||
|
||||
@@ -38,7 +38,7 @@ android {
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 32
|
||||
versionCode 69
|
||||
versionName "5.3.5"
|
||||
versionName "5.3.7"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
vectorDrawables.useSupportLibrary = true
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@ import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.sync.Mutex
|
||||
import kotlinx.coroutines.sync.withLock
|
||||
import kotlinx.datetime.Clock.System.now
|
||||
import kotlinx.datetime.Instant
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.decodeFromString
|
||||
import kotlinx.serialization.json.Json
|
||||
@@ -139,7 +138,7 @@ const val nozomiextension = ".nozomi"
|
||||
val evaluationContext = Dispatchers.Main + Job()
|
||||
|
||||
object gg {
|
||||
private var lastRetrieval: Instant? = null
|
||||
private var lastRetrieval: Long? = null
|
||||
|
||||
private val mutex = Mutex()
|
||||
|
||||
@@ -151,7 +150,7 @@ object gg {
|
||||
@OptIn(ExperimentalTime::class, ExperimentalCoroutinesApi::class)
|
||||
private suspend fun refresh() = withContext(Dispatchers.IO) {
|
||||
mutex.withLock {
|
||||
if (lastRetrieval == null || (lastRetrieval!! + 1.minutes) < now()) {
|
||||
if (lastRetrieval == null || (lastRetrieval!! + 60000) < System.currentTimeMillis()) {
|
||||
val ggjs: String = suspendCancellableCoroutine { continuation ->
|
||||
val call = client.newCall(Request.Builder().url("https://ltn.hitomi.la/gg.js").build())
|
||||
|
||||
@@ -188,7 +187,7 @@ object gg {
|
||||
|
||||
b = Regex("b: '(.+)'").find(ggjs)!!.groupValues[1]
|
||||
|
||||
lastRetrieval = now()
|
||||
lastRetrieval = System.currentTimeMillis()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user