Fixed issue for app level check.

This commit is contained in:
mayur nilwant 2024-06-10 22:39:55 -04:00
parent 7a25d12be4
commit 7f27bb502e
3 changed files with 2 additions and 4 deletions

View File

@ -81,7 +81,7 @@ public class CachedData: Codable {
MVMCoreLoggingHandler.logDebugMessage(withDelegate: "CACHEDFEED: EXPIRED, key:\(key), path:\(path)")
throw CacheError.dataExpired
}
} catch (let error){
} catch {
// Remove item from the cache on any failure.
try fileManager.removeItem(at: path)

View File

@ -199,7 +199,5 @@ typedef void(^MVMCoreGetImageBlock)(UIImage * _Nullable, NSData * _Nullable, BOO
/// Loads an AVPlayerAsset from the shared asset cache.
- (void)playerAssetFromFileName:(nonnull NSString *)filename trackKeys:(nonnull NSArray *)trackKeys onComplete:(void(^_Nonnull)(AVAsset * _Nullable, NSString * _Nonnull, MVMCoreErrorObject * _Nullable))completionHandler;
- (BOOL)shouldSaveAtAppLevel:(nonnull NSDictionary *)jsonDictionary;
-(void) clearPersistentAppLevelCache;
@end

View File

@ -141,7 +141,7 @@ static NSString * const STATIC_CACHE_COMPONENT = @"StaticCache.txt";
- (BOOL)shouldSaveAtAppLevel:(nonnull NSDictionary *)jsonDictionary{
NSDictionary *cachePolicy = [jsonDictionary dict:KeyCachePolicy];
if (!cachePolicy || ![cachePolicy boolForKey:@"persist"] || ![cachePolicy boolForKey:@"applicationLevelCache"]) {
if (![cachePolicy boolForKey:@"applicationLevelCache"] || ![self shouldPersistentlyCacheJSON:jsonDictionary]) {
return NO;
}
return true;