|
@@ -35,6 +35,7 @@ class NCSelect: UIViewController, UIGestureRecognizerDelegate, UIAdaptivePresent
|
|
|
@IBOutlet private var buttonCancel: UIBarButtonItem!
|
|
|
@IBOutlet private var bottomContraint: NSLayoutConstraint?
|
|
|
|
|
|
+ private let appDelegate = (UIApplication.shared.delegate as? AppDelegate)!
|
|
|
private var selectCommandViewSelect: NCSelectCommandView?
|
|
|
|
|
|
@objc enum selectType: Int {
|
|
@@ -300,7 +301,15 @@ extension NCSelect: UICollectionViewDataSource {
|
|
|
if FileManager().fileExists(atPath: CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, etag: metadata.etag)) {
|
|
|
(cell as? NCCellProtocol)?.filePreviewImageView?.image = UIImage(contentsOfFile: CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, etag: metadata.etag))
|
|
|
} else {
|
|
|
- NCOperationQueue.shared.downloadThumbnail(metadata: metadata, placeholder: true, cell: cell, view: collectionView)
|
|
|
+ if metadata.iconName.isEmpty {
|
|
|
+ (cell as? NCCellProtocol)?.filePreviewImageView?.image = NCBrandColor.cacheImages.file
|
|
|
+ } else {
|
|
|
+ (cell as? NCCellProtocol)?.filePreviewImageView?.image = UIImage(named: metadata.iconName)
|
|
|
+ }
|
|
|
+ if metadata.hasPreview && metadata.status == NCGlobal.shared.metadataStatusNormal && (!CCUtility.fileProviderStoragePreviewIconExists(metadata.ocId, etag: metadata.etag)) {
|
|
|
+ for case let operation as NCOperationDownloadThumbnail in appDelegate.downloadThumbnailQueue.operations where operation.metadata.ocId == metadata.ocId { return }
|
|
|
+ appDelegate.downloadThumbnailQueue.addOperation(NCOperationDownloadThumbnail(metadata: metadata, cell: (cell as? NCCellProtocol), view: view))
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|