From 7f27bb502e9b5bee523966ad982b4cb7b7ec7a36 Mon Sep 17 00:00:00 2001 From: mayur nilwant Date: Mon, 10 Jun 2024 22:39:55 -0400 Subject: [PATCH] Fixed issue for app level check. --- MVMCore/MVMCore/OtherHandlers/MVMCoreCache+Extension.swift | 2 +- MVMCore/MVMCore/OtherHandlers/MVMCoreCache.h | 2 -- MVMCore/MVMCore/OtherHandlers/MVMCoreCache.m | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/MVMCore/MVMCore/OtherHandlers/MVMCoreCache+Extension.swift b/MVMCore/MVMCore/OtherHandlers/MVMCoreCache+Extension.swift index abad727..a316bc8 100644 --- a/MVMCore/MVMCore/OtherHandlers/MVMCoreCache+Extension.swift +++ b/MVMCore/MVMCore/OtherHandlers/MVMCoreCache+Extension.swift @@ -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) diff --git a/MVMCore/MVMCore/OtherHandlers/MVMCoreCache.h b/MVMCore/MVMCore/OtherHandlers/MVMCoreCache.h index 6e05e75..6ba15d1 100644 --- a/MVMCore/MVMCore/OtherHandlers/MVMCoreCache.h +++ b/MVMCore/MVMCore/OtherHandlers/MVMCoreCache.h @@ -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 diff --git a/MVMCore/MVMCore/OtherHandlers/MVMCoreCache.m b/MVMCore/MVMCore/OtherHandlers/MVMCoreCache.m index 935bbb8..9fda084 100644 --- a/MVMCore/MVMCore/OtherHandlers/MVMCoreCache.m +++ b/MVMCore/MVMCore/OtherHandlers/MVMCoreCache.m @@ -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;