Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/NextcloudKit/NextcloudKit+Upload.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
} .responseData(queue: self.nkCommonInstance.backgroundQueue) { response in
var ocId: String?, etag: String?, date: Date?
var result: NKError

Check warning on line 58 in Sources/NextcloudKit/NextcloudKit+Upload.swift

View workflow job for this annotation

GitHub Actions / Lint

Trailing Whitespace Violation: Lines should not have trailing whitespace (trailing_whitespace)
if self.nkCommonInstance.findHeader("oc-fileid", allHeaderFields: response.response?.allHeaderFields) != nil {
ocId = self.nkCommonInstance.findHeader("oc-fileid", allHeaderFields: response.response?.allHeaderFields)
} else if self.nkCommonInstance.findHeader("fileid", allHeaderFields: response.response?.allHeaderFields) != nil {
Expand All @@ -72,7 +72,7 @@
if let dateRaw = self.nkCommonInstance.findHeader("date", allHeaderFields: response.response?.allHeaderFields) {
date = dateRaw.parsedDate(using: "EEE, dd MMM y HH:mm:ss zzz")
}

Check warning on line 75 in Sources/NextcloudKit/NextcloudKit+Upload.swift

View workflow job for this annotation

GitHub Actions / Lint

Trailing Whitespace Violation: Lines should not have trailing whitespace (trailing_whitespace)
if !uploadCompleted {
nkLog(error: "Upload incomplete: only \(uploadedSize) bytes sent.")
result = .uploadIncomplete
Expand Down Expand Up @@ -138,7 +138,7 @@
do {
fsAttributes = try FileManager.default.attributesOfFileSystem(forPath: "/")
} catch {
return completion(account, nil, nil, nil, NKError(errorCode: NKError.chunkNoEnoughMemory))
return completion(account, nil, nil, .errorChunkNoEnoughMemory)
}
let freeDisk = ((fsAttributes[FileAttributeKey.systemFreeSize] ?? 0) as? Int64) ?? 0
#elseif os(visionOS) || os(iOS)
Expand Down Expand Up @@ -248,7 +248,7 @@

self.moveFileOrFolder(serverUrlFileNameSource: serverUrlFileNameSource, serverUrlFileNameDestination: serverUrlFileName, overwrite: true, account: account, options: options) { _, _, error in
guard error == .success else {
return completion(account, filesChunkOutput, nil,.errorChunkMoveFile)

Check warning on line 251 in Sources/NextcloudKit/NextcloudKit+Upload.swift

View workflow job for this annotation

GitHub Actions / Lint

Comma Spacing Violation: There should be no space before and one after any comma (comma)
}
self.readFileOrFolder(serverUrlFileName: serverUrlFileName, depth: "0", account: account, options: NKRequestOptions(queue: self.nkCommonInstance.backgroundQueue)) { _, files, _, error in
guard error == .success, let file = files?.first else {
Expand Down
Loading