marinofaggiana 3 jaren geleden
bovenliggende
commit
97db96ea2c
3 gewijzigde bestanden met toevoegingen van 8 en 3 verwijderingen
  1. 1 1
      iOSClient/Data/NCManageDatabase.swift
  2. 1 1
      iOSClient/NCGlobal.swift
  3. 6 1
      iOSClient/Networking/NCOperationQueue.swift

+ 1 - 1
iOSClient/Data/NCManageDatabase.swift

@@ -116,7 +116,7 @@ class NCManageDatabase: NSObject {
                         }
                     }
                     
-                    if oldSchemaVersion < 204 {
+                    if oldSchemaVersion < 205 {
                         migration.deleteData(forType: tableDirectory.className())
                         migration.deleteData(forType: tableE2eEncryption.className())
                         migration.deleteData(forType: tableE2eEncryptionLock.className())

+ 1 - 1
iOSClient/NCGlobal.swift

@@ -79,7 +79,7 @@ class NCGlobal: NSObject {
     // Database Realm
     //
     let databaseDefault                             = "nextcloud.realm"
-    let databaseSchemaVersion: UInt64               = 204
+    let databaseSchemaVersion: UInt64               = 205
     
     // Intro selector
     //

+ 6 - 1
iOSClient/Networking/NCOperationQueue.swift

@@ -177,6 +177,11 @@ import NCCommunication
             cell.fileAvatarImageView?.image = placeholder
         }
         
+        for operation in downloadAvatarQueue.operations as! [NCOperationDownloadAvatar] {
+            if operation.fileName == fileName {
+                return
+            }
+        }
         downloadAvatarQueue.addOperation(NCOperationDownloadAvatar.init(user: user, fileName: fileName, fileNameLocalPath: fileNameLocalPath, cell: cell, view: view))
     }
     
@@ -470,7 +475,7 @@ class NCOperationDownloadAvatar: ConcurrentOperation {
         } else {
             NCCommunication.shared.downloadAvatar(user: user, fileNameLocalPath: fileNameLocalPath, sizeImage: NCGlobal.shared.avatarSize, avatarSizeRounded: NCGlobal.shared.avatarSizeRounded, etag: self.etag) { (account, imageAvatar, imageOriginal, etag, errorCode, errorMessage) in
                 
-                if errorCode == 0, let imageAvatar = imageAvatar, let etag = etag, let imageOriginal = imageOriginal {
+                if errorCode == 0, let imageAvatar = imageAvatar, let etag = etag {
                     
                     NCManageDatabase.shared.addAvatar(fileName: self.fileName, etag: etag)