mirror of
https://github.com/gedoor/legado.git
synced 2024-07-06 23:47:49 +08:00
优化
This commit is contained in:
parent
ddb4dcab1c
commit
d46c11705f
@ -28,10 +28,6 @@ object CacheManager {
|
||||
}
|
||||
}
|
||||
|
||||
fun putString2File(key: String, value: String, saveTime: Int = 0) {
|
||||
ACache.get(appCtx).put(key, value, saveTime)
|
||||
}
|
||||
|
||||
fun get(key: String): String? {
|
||||
return appDb.cacheDao.get(key, System.currentTimeMillis())
|
||||
}
|
||||
@ -56,10 +52,6 @@ object CacheManager {
|
||||
return ACache.get(appCtx).getAsBinary(key)
|
||||
}
|
||||
|
||||
fun getString(key: String): String? {
|
||||
return ACache.get(appCtx).getAsString(key)
|
||||
}
|
||||
|
||||
fun getQueryTTF(key: String): QueryTTF? {
|
||||
val cache = queryTTFMap[key] ?: return null
|
||||
if (cache.first == 0L || cache.first > System.currentTimeMillis()) {
|
||||
@ -68,6 +60,14 @@ object CacheManager {
|
||||
return null
|
||||
}
|
||||
|
||||
fun putFile(key: String, value: String, saveTime: Int = 0) {
|
||||
ACache.get(appCtx).put(key, value, saveTime)
|
||||
}
|
||||
|
||||
fun getFile(key: String): String? {
|
||||
return ACache.get(appCtx).getAsString(key)
|
||||
}
|
||||
|
||||
fun delete(key: String) {
|
||||
appDb.cacheDao.delete(key)
|
||||
ACache.get(appCtx).remove(key)
|
||||
|
Loading…
Reference in New Issue
Block a user