diff options
author | marinofaggiana <marino@marinofaggiana.com> | 2020-07-09 18:27:05 +0300 |
---|---|---|
committer | marinofaggiana <marino@marinofaggiana.com> | 2020-07-09 18:27:05 +0300 |
commit | a7d781d336152408c0743fd8792c00f49c67b9a8 (patch) | |
tree | 2303e4547d46c008468d81cdc51391a7582fba40 /File Provider Extension | |
parent | 5cd54130f631c2283f0329f1b044f53dab56f8da (diff) |
coding
Diffstat (limited to 'File Provider Extension')
-rw-r--r-- | File Provider Extension/FileProviderEnumerator.swift | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/File Provider Extension/FileProviderEnumerator.swift b/File Provider Extension/FileProviderEnumerator.swift index 4b321b94b..ac73a3014 100644 --- a/File Provider Extension/FileProviderEnumerator.swift +++ b/File Provider Extension/FileProviderEnumerator.swift @@ -222,8 +222,8 @@ class FileProviderEnumerator: NSObject, NSFileProviderEnumerator { if errorCode == 0 { DispatchQueue.global().async { NCManageDatabase.sharedInstance.convertNCCommunicationFilesToMetadatas(files, useMetadataFolder: true, account: account) { (metadataFolder, metadatasFolder, metadatas) in - let filter = "account == " + account + " AND serverUrl == " + serverUrl - NCManageDatabase.sharedInstance.updateMetadatasWithFilter(filter, metadatas: metadatas) + let predicate = NSPredicate(format: "account == %@ AND serverUrl == %@", account, serverUrl) + NCManageDatabase.sharedInstance.updateMetadatasWithPredicate(predicate, 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) @@ -262,8 +262,8 @@ class FileProviderEnumerator: NSObject, NSFileProviderEnumerator { if errorCode == 0 { DispatchQueue.global().async { NCManageDatabase.sharedInstance.convertNCCommunicationFilesToMetadatas(files, useMetadataFolder: false, account: account) { (metadataFolder, metadatasFolder, metadatas) in - let filter = "account == " + account + " AND serverUrl == " + serverUrl - NCManageDatabase.sharedInstance.updateMetadatasWithFilter(filter, metadatas: metadatas) + let predicate = NSPredicate(format: "account == %@ AND serverUrl == %@", account, serverUrl) + NCManageDatabase.sharedInstance.updateMetadatasWithPredicate(predicate, 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) |