Marino Faggiana 8 년 전
부모
커밋
29c8931997
1개의 변경된 파일8개의 추가작업 그리고 7개의 파일을 삭제
  1. 8 7
      iOSClient/FileSystem/NCManageDatabase.swift

+ 8 - 7
iOSClient/FileSystem/NCManageDatabase.swift

@@ -564,6 +564,8 @@ class NCManageDatabase: NSObject {
         var itemsLink = [OCSharedDto]()
         var itemsUsersAndGroups = [OCSharedDto]()
         
+        // Manage sharesLink
+        
         for (idRemoteShared,_) in items {
             
             let item = items[idRemoteShared]!
@@ -577,7 +579,6 @@ class NCManageDatabase: NSObject {
             }
         }
         
-        // Link
         for item in itemsLink {
             
             let fullPath = CCUtility.getHomeServerUrlActiveUrl(activeUrl) + "\(item.path!)"
@@ -596,8 +597,9 @@ class NCManageDatabase: NSObject {
             }
         }
         
-        // Create dictionary
-        var paths = [String:[String]]() //Key, value
+        // Manage sharesUserAndGroup
+        
+        var paths = [String:[String]]()
         
         for item in itemsUsersAndGroups {
             
@@ -613,15 +615,14 @@ class NCManageDatabase: NSObject {
             }
         }
         
-        // Write on DB
-        for (key, _) in paths {
+        for (path, _) in paths {
             
-            let items = paths[key]
+            let items = paths[path]
             let share = items?.joined(separator: ",")
             
             print("[LOG] share \(String(describing: share))")
             
-            let fullPath = CCUtility.getHomeServerUrlActiveUrl(activeUrl) + "\(key)"
+            let fullPath = CCUtility.getHomeServerUrlActiveUrl(activeUrl) + "\(path)"
             let fileName = NSString(string: fullPath).lastPathComponent
             var serverUrl = NSString(string: fullPath).substring(to: (fullPath.characters.count - fileName.characters.count - 1))