File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -71,13 +71,16 @@ - (NSData *)dataForKey:(NSString *)key {
71
71
}
72
72
NSData *data = [NSData dataWithContentsOfFile: filePath options: self .config.diskCacheReadingOptions error: nil ];
73
73
if (data) {
74
+ [[NSURL fileURLWithPath: filePath] setResourceValue: [NSDate date ] forKey: NSURLContentAccessDateKey error: nil ];
74
75
return data;
75
76
}
76
77
77
78
// fallback because of https://github.com/rs/SDWebImage/pull/976 that added the extension to the disk file name
78
79
// checking the key with and without the extension
79
- data = [NSData dataWithContentsOfFile: filePath.stringByDeletingPathExtension options: self .config.diskCacheReadingOptions error: nil ];
80
+ filePath = filePath.stringByDeletingPathExtension ;
81
+ data = [NSData dataWithContentsOfFile: filePath options: self .config.diskCacheReadingOptions error: nil ];
80
82
if (data) {
83
+ [[NSURL fileURLWithPath: filePath] setResourceValue: [NSDate date ] forKey: NSURLContentAccessDateKey error: nil ];
81
84
return data;
82
85
}
83
86
You can’t perform that action at this time.
0 commit comments