diff options
author | marinofaggiana <marino@marinofaggiana.com> | 2020-07-09 18:15:01 +0300 |
---|---|---|
committer | marinofaggiana <marino@marinofaggiana.com> | 2020-07-09 18:15:01 +0300 |
commit | 5cd54130f631c2283f0329f1b044f53dab56f8da (patch) | |
tree | e7bf314995f20287f253ac1d825e866ee31e8670 /File Provider Extension | |
parent | cc3193459a15019744e630ea1ac4e7c2560d7462 (diff) |
coding
Diffstat (limited to 'File Provider Extension')
-rw-r--r-- | File Provider Extension/FileProviderEnumerator.swift | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/File Provider Extension/FileProviderEnumerator.swift b/File Provider Extension/FileProviderEnumerator.swift index 982f8fecf..4b321b94b 100644 --- a/File Provider Extension/FileProviderEnumerator.swift +++ b/File Provider Extension/FileProviderEnumerator.swift @@ -222,7 +222,8 @@ class FileProviderEnumerator: NSObject, NSFileProviderEnumerator { if errorCode == 0 { DispatchQueue.global().async { NCManageDatabase.sharedInstance.convertNCCommunicationFilesToMetadatas(files, useMetadataFolder: true, account: account) { (metadataFolder, metadatasFolder, metadatas) in - NCManageDatabase.sharedInstance.updateMetadatasServerUrl(serverUrl, account: account, metadatas: metadatas) + let filter = "account == " + account + " AND serverUrl == " + serverUrl + NCManageDatabase.sharedInstance.updateMetadatasWithFilter(filter, metadatas: metadatas) for metadata in metadatasFolder { let serverUrl = metadata.serverUrl + "/" + metadata.fileNameView NCManageDatabase.sharedInstance.addDirectory(encrypted: metadata.e2eEncrypted, favorite: metadata.favorite, ocId: metadata.ocId, fileId: metadata.fileId, etag: nil, permissions: metadata.permissions, serverUrl: serverUrl, richWorkspace: metadata.richWorkspace, account: metadata.account) @@ -261,7 +262,8 @@ class FileProviderEnumerator: NSObject, NSFileProviderEnumerator { if errorCode == 0 { DispatchQueue.global().async { NCManageDatabase.sharedInstance.convertNCCommunicationFilesToMetadatas(files, useMetadataFolder: false, account: account) { (metadataFolder, metadatasFolder, metadatas) in - NCManageDatabase.sharedInstance.updateMetadatasServerUrl(serverUrl, account: account, metadatas: metadatas) + let filter = "account == " + account + " AND serverUrl == " + serverUrl + NCManageDatabase.sharedInstance.updateMetadatasWithFilter(filter, metadatas: metadatas) for metadata in metadatasFolder { let serverUrl = metadata.serverUrl + "/" + metadata.fileNameView NCManageDatabase.sharedInstance.addDirectory(encrypted: metadata.e2eEncrypted, favorite: metadata.favorite, ocId: metadata.ocId, fileId: metadata.fileId, etag: nil, permissions: metadata.permissions, serverUrl: serverUrl, richWorkspace: nil, account: metadata.account) |