Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Marino Faggiana <[email protected]>
  • Loading branch information
marinofaggiana committed Dec 5, 2024
1 parent b759203 commit b675fe1
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions File Provider Extension/FileProviderExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -254,19 +254,19 @@ class FileProviderExtension: NSFileProviderExtension {
selector: "",
status: NCGlobal.shared.metadataStatusUploading)

DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
if let task = NKBackground(nkCommonInstance: NextcloudKit.shared.nkCommonInstance).upload(serverUrlFileName: serverUrlFileName,
fileNameLocalPath: url.path,
dateCreationFile: nil,
dateModificationFile: nil,
overwrite: true,
account: metadata.account,
sessionIdentifier: metadata.session) {
self.database.setMetadataSession(ocId: metadata.ocId,
sessionTaskIdentifier: task.taskIdentifier,
status: NCGlobal.shared.metadataStatusUploading)
fileProviderData.shared.fileProviderManager.register(task, forItemWithIdentifier: NSFileProviderItemIdentifier(metadata.fileId)) { _ in }
}
if let task = NKBackground(nkCommonInstance: NextcloudKit.shared.nkCommonInstance).upload(serverUrlFileName: serverUrlFileName,
fileNameLocalPath: url.path,
dateCreationFile: nil,
dateModificationFile: nil,
overwrite: true,
account: metadata.account,
sessionIdentifier: NCNetworking.shared.sessionUploadBackgroundExt) {
self.database.setMetadataSession(ocId: metadata.ocId,
sessionTaskIdentifier: task.taskIdentifier,
status: NCGlobal.shared.metadataStatusUploading)
fileProviderData.shared.fileProviderManager.register(task, forItemWithIdentifier: NSFileProviderItemIdentifier(metadata.fileId)) { _ in }
} else {
print("error")
}
}

Expand Down

0 comments on commit b675fe1

Please sign in to comment.