Skip to content

Commit

Permalink
improvements
Browse files Browse the repository at this point in the history
Signed-off-by: Marino Faggiana <[email protected]>
  • Loading branch information
marinofaggiana committed Oct 18, 2023
1 parent 874646c commit 19158fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions iOSClient/Media/NCMedia.swift
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,11 @@ extension NCMedia: UICollectionViewDataSource {
cell.imageItem.backgroundColor = nil
cell.imageItem.image = image
} else if FileManager().fileExists(atPath: CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, etag: metadata.etag)) {
cell.imageItem.backgroundColor = nil
cell.imageItem.image = UIImage(contentsOfFile: CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, etag: metadata.etag))
if let image = UIImage(contentsOfFile: CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, etag: metadata.etag)) {
cell.imageItem.backgroundColor = nil
cell.imageItem.image = image
NCMediaManager.shared.setImage(ocId: metadata.ocId, image: image)
}
} else {
NCOperationQueue.shared.downloadThumbnail(metadata: metadata, placeholder: false, cell: cell, view: collectionView)
}
Expand Down
2 changes: 1 addition & 1 deletion iOSClient/Media/NCMediaManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class NCMediaManager {
}()

typealias ThumbnailLRUCache = LRUCache<String, UIImage>
let cache: ThumbnailLRUCache = ThumbnailLRUCache(countLimit: 1000)
let cache: ThumbnailLRUCache = ThumbnailLRUCache(countLimit: 2000)

func createCache(account: String) {

Expand Down

0 comments on commit 19158fd

Please sign in to comment.