This commit is contained in:
Xwite 2023-03-25 14:24:29 +08:00
parent c16bb35436
commit 38307689a9

View File

@ -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)