Browse Source

cleaning

Signed-off-by: Marino Faggiana <8616947+marinofaggiana@users.noreply.github.com>
Marino Faggiana 1 year ago
parent
commit
8faa52a19d

+ 1 - 1
iOSClient/Main/Collection Common/NCCollectionViewCommon.swift

@@ -1245,7 +1245,7 @@ extension NCCollectionViewCommon: UICollectionViewDataSource {
         }
     }
 
-    func collectionView(_ collectionView: UICollectionView, didEndDisplaying cell: UICollectionViewCell, forItemAt indexPath: IndexPath) { 
+    func collectionView(_ collectionView: UICollectionView, didEndDisplaying cell: UICollectionViewCell, forItemAt indexPath: IndexPath) {
         if !collectionView.indexPathsForVisibleItems.contains(indexPath) {
             guard let metadata = dataSource.cellForItemAt(indexPath: indexPath) else { return }
             NCOperationQueue.shared.cancelDownloadThumbnail(metadata: metadata)

+ 4 - 4
iOSClient/Networking/NCOperationQueue.swift

@@ -194,16 +194,16 @@ class NCOperationDownloadThumbnail: ConcurrentOperation {
             fileNameIconLocalPath: fileNameIconLocalPath,
             sizeIcon: NCGlobal.shared.sizeIcon,
             etag: etagResource,
-            options: NKRequestOptions(queue: NextcloudKit.shared.nkCommonInstance.backgroundQueue)) { _, imagePreview, imageIcon, _, etag, error in
+            options: NKRequestOptions(queue: NextcloudKit.shared.nkCommonInstance.backgroundQueue)) { _, imagePreview, _, _, etag, error in
 
-            if error == .success, let imageIcon = imageIcon {
+            if error == .success, let image = imagePreview  {
                 NCManageDatabase.shared.setMetadataEtagResource(ocId: self.metadata.ocId, etagResource: etag)
                 DispatchQueue.main.async {
                     if self.metadata.ocId == self.cell?.fileObjectId, let filePreviewImageView = self.cell?.filePreviewImageView {
                         UIView.transition(with: filePreviewImageView,
                                           duration: 0.75,
                                           options: .transitionCrossDissolve,
-                                          animations: { filePreviewImageView.image = imageIcon },
+                                          animations: { filePreviewImageView.image = image },
                                           completion: nil)
                     } else {
                         if self.view is UICollectionView {
@@ -214,7 +214,7 @@ class NCOperationDownloadThumbnail: ConcurrentOperation {
                     }
                     NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterDownloadedThumbnail, userInfo: ["ocId": self.metadata.ocId])
                 }
-                NCMediaManager.shared.setImage(ocId: self.metadata.ocId, image: imageIcon)
+                NCMediaManager.shared.setImage(ocId: self.metadata.ocId, image: image)
             }
             self.finish()
         }