mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
优化
This commit is contained in:
@@ -198,7 +198,10 @@ interface JsExtensions : JsEncodeUtils {
|
||||
fun cacheFile(urlStr: String, saveTime: Int): String {
|
||||
val key = md5Encode16(urlStr)
|
||||
val cahcePath = CacheManager.get(key)
|
||||
return if (cahcePath.isNullOrBlank()) {
|
||||
return if (
|
||||
cahcePath.isNullOrBlank() ||
|
||||
!getFile(cahcePath).exists()
|
||||
) {
|
||||
val path = downloadFile(urlStr)
|
||||
log("首次下载 $urlStr >> $path")
|
||||
CacheManager.put(key, path, saveTime)
|
||||
|
||||
Reference in New Issue
Block a user