Only reimport entire file provider domain if there have been no recorded files when ncAccount is configured

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2023-02-01 18:20:44 +01:00
parent 9c18d36f41
commit c4580183e7
No known key found for this signature in database
GPG key ID: C839200C384636B0

View file

@ -155,9 +155,9 @@ class FileProviderExtension: NSObject, NSFileProviderReplicatedExtension, NKComm
assert(ncAccount != nil)
if true { // TODO: only run this if we need to refresh root container and it is the first ever sync
// This refreshes the entire structure of the FileProvider and calls enumerateItems
// rather than enumerateChanges in the enumerator
if !NextcloudFilesDatabaseManager.shared.anyItemMetadatasForAccount(ncAccount!.ncKitAccount) {
// This refreshes the entire structure of the FileProvider and calls
// enumerateItems rather than enumerateChanges in the enumerator
NSLog("Signalling manager for user %@ at server %@ to reimport everything", ncAccount!.username, ncAccount!.serverUrl)
fpManager.reimportItems(below: .rootContainer, completionHandler: {_ in })
return