mirror of
https://github.com/gedoor/legado.git
synced 2024-09-03 09:55:00 +08:00
[skip ci] fix typo
This commit is contained in:
parent
38307689a9
commit
bed7a5a6a7
@ -197,17 +197,17 @@ interface JsExtensions : JsEncodeUtils {
|
||||
*/
|
||||
fun cacheFile(urlStr: String, saveTime: Int): String {
|
||||
val key = md5Encode16(urlStr)
|
||||
val cahcePath = CacheManager.get(key)
|
||||
val cachePath = CacheManager.get(key)
|
||||
return if (
|
||||
cahcePath.isNullOrBlank() ||
|
||||
!getFile(cahcePath).exists()
|
||||
cachePath.isNullOrBlank() ||
|
||||
!getFile(cachePath).exists()
|
||||
) {
|
||||
val path = downloadFile(urlStr)
|
||||
log("首次下载 $urlStr >> $path")
|
||||
CacheManager.put(key, path, saveTime)
|
||||
readTxtFile(path)
|
||||
} else {
|
||||
readTxtFile(cahcePath)
|
||||
readTxtFile(cachePath)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user