This commit is contained in:
Kovid Goyal 2023-03-14 20:32:38 +05:30
parent 9443b0e361
commit f6d66b2336
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -354,10 +354,10 @@ func fetch_cached(name, url, cache_path string, max_cache_age time.Duration) (st
if err != nil && !errors.Is(err, fs.ErrNotExist) {
return "", err
}
defer zf.Close()
var jm JSONMetadata
if err == nil {
defer zf.Close()
err = json.Unmarshal(utils.UnsafeStringToBytes(zf.Comment), &jm)
if max_cache_age < 0 {
return cache_path, nil