Skip to content

Commit 28cf181

Browse files
author
zerox80
committed
fix: resolve detekt issues and syntax error in TusUploadHelper
1 parent 53d22cd commit 28cf181

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

opencloudApp/src/main/java/eu/opencloud/android/workers/TusUploadHelper.kt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,19 @@ class TusUploadHelper(
8484
mimetype = mimeType,
8585
metadata = metadata,
8686
useCreationWithUpload = true,
87+
firstChunkSize = firstChunkSize,
88+
tusUrl = "",
89+
collectionUrlOverride = collectionUrl,
90+
).execute(client)
91+
}
92+
93+
if (creationResult == null) {
94+
throw java.io.IOException("TUS: unable to create upload resource for $remotePath")
95+
}
96+
97+
tusUrl = creationResult.uploadUrl
98+
createdOffset = creationResult.uploadOffset
99+
val metadataString = metadata.entries.joinToString(";") { (key, value) -> "$key=$value" }
87100

88101
transferRepository.updateTusState(
89102
id = uploadId,

opencloudComLibrary/src/test/java/eu/opencloud/android/lib/resources/files/tus/TusIntegrationTest.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ class TusIntegrationTest {
123123
assertNotNull(creationResult)
124124
val absoluteLocation = creationResult!!.uploadUrl
125125
val offset = creationResult.uploadOffset
126-
127126
println("absoluteLocation: $absoluteLocation")
128127
println("locationPath: $locationPath")
129128
println("endsWith: ${absoluteLocation.endsWith(locationPath)}")

0 commit comments

Comments
 (0)