From c56743fb5f534216c009dd5c0d2e295ccf75be5f Mon Sep 17 00:00:00 2001 From: Marino Faggiana <8616947+marinofaggiana@users.noreply.github.com> Date: Wed, 18 Oct 2023 15:47:40 +0200 Subject: [PATCH] improvements Signed-off-by: Marino Faggiana <8616947+marinofaggiana@users.noreply.github.com> --- iOSClient/Media/NCMediaManager.swift | 6 +++--- iOSClient/Settings/CCAdvanced.m | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/iOSClient/Media/NCMediaManager.swift b/iOSClient/Media/NCMediaManager.swift index 25213d93e7..36da777b79 100644 --- a/iOSClient/Media/NCMediaManager.swift +++ b/iOSClient/Media/NCMediaManager.swift @@ -10,7 +10,7 @@ import UIKit import LRUCache import NextcloudKit -@objc class NCMediaManager { +@objc class NCMediaManager: NSObject { @objc public static let shared: NCMediaManager = { let instance = NCMediaManager() @@ -18,9 +18,9 @@ import NextcloudKit }() private typealias ThumbnailLRUCache = LRUCache - private let cache: ThumbnailLRUCache = ThumbnailLRUCache(countLimit: 1500) + private let cache: ThumbnailLRUCache = ThumbnailLRUCache(countLimit: 2000) - func createCache(account: String) { + @objc func createCache(account: String) { let resultsMedia = NCManageDatabase.shared.getMediaOcIdEtag(account: account) guard !resultsMedia.isEmpty, diff --git a/iOSClient/Settings/CCAdvanced.m b/iOSClient/Settings/CCAdvanced.m index 61ec16e0b8..a583752723 100755 --- a/iOSClient/Settings/CCAdvanced.m +++ b/iOSClient/Settings/CCAdvanced.m @@ -161,6 +161,8 @@ - (void)initializeForm } else { [[[NextcloudKit shared] nkCommonInstance] writeLog:[NSString stringWithFormat:@"[INFO] Clear log with level %lu %@", (unsigned long)logLevel, versionNextcloudiOS]]; } + + [[NCMediaManager shared] createCacheWithAccount:appDelegate.account]; }; [section addFormRow:row];