Get rid of redundant boxing

Koitharu 1 year ago
parent 3b173dc6fc
commit 3ffcefaa1b
Signed by: Koitharu
GPG Key ID: 676DEE768C17A9D7

@ -632,14 +632,14 @@ internal class HitomiLaParser(context: MangaLoaderContext) : MangaParser(context
// / ---> // / --->
private var scriptLastRetrieval: Long? = null private var scriptLastRetrieval: Long = -1L
private val mutex = Mutex() private val mutex = Mutex()
private var subdomainOffsetDefault = 0 private var subdomainOffsetDefault = 0
private val subdomainOffsetMap = mutableMapOf<Int, Int>() private val subdomainOffsetMap = mutableMapOf<Int, Int>()
private var commonImageId = "" private var commonImageId = ""
private suspend fun refreshScript() = mutex.withLock { private suspend fun refreshScript() = mutex.withLock {
if (scriptLastRetrieval == null || (scriptLastRetrieval!! + 60000) < System.currentTimeMillis()) { if (scriptLastRetrieval == -1L || (scriptLastRetrieval + 60000) < System.currentTimeMillis()) {
val ggScript = webClient.httpGet("$ltnBaseUrl/gg.js?_=${System.currentTimeMillis()}").parseRaw() val ggScript = webClient.httpGet("$ltnBaseUrl/gg.js?_=${System.currentTimeMillis()}").parseRaw()
subdomainOffsetDefault = Regex("var o = (\\d)").find(ggScript)!!.groupValues[1].toInt() subdomainOffsetDefault = Regex("var o = (\\d)").find(ggScript)!!.groupValues[1].toInt()

@ -213,6 +213,8 @@ internal abstract class WebtoonsParser(
state = null, state = null,
source = source, source = source,
), ),
date = 0L,
readCount = 0L,
) )
} }
} }
@ -331,9 +333,9 @@ internal abstract class WebtoonsParser(
} }
} }
private inner class MangaWebtoon( private class MangaWebtoon(
val manga: Manga, @JvmField val manga: Manga,
@JvmField val date: Long? = null, @JvmField val date: Long,
@JvmField val readCount: Long? = null, // FIXME get rid of boxing @JvmField val readCount: Long,
) )
} }

Loading…
Cancel
Save