Commit 6084ecda authored by Matthieu's avatar Matthieu

Merge branch 'posting_fix' into 'master'

Fix multi upload

See merge request !300
parents 111182e9 ed1d35b5
Pipeline #389 passed with stages
in 6 minutes and 46 seconds
......@@ -284,7 +284,11 @@ class PostCreationActivity : BaseActivity() {
}
var postSub: Disposable? = null
val inter = pixelfedAPI.mediaUpload("Bearer $accessToken", data.imageDescription, requestBody.parts[0])
val description = data.imageDescription?.let { MultipartBody.Part.createFormData("description", it) }
val inter = pixelfedAPI.mediaUpload("Bearer $accessToken", description, requestBody.parts[0])
postSub = inter
.subscribeOn(Schedulers.io())
......@@ -302,7 +306,7 @@ class PostCreationActivity : BaseActivity() {
},
{
data.progress = 100
if(photoData.all{it.progress == 100}){
if(photoData.all{it.progress == 100 && it.uploadId != null}){
binding.uploadProgressBar.visibility = View.GONE
binding.uploadCompletedTextview.visibility = View.VISIBLE
post()
......
......@@ -256,7 +256,7 @@ interface PixelfedAPI {
fun mediaUpload(
//The authorization header needs to be of the form "Bearer <token>"
@Header("Authorization") authorization: String,
@Part("description") description: String?,
@Part description: MultipartBody.Part? = null,
@Part file: MultipartBody.Part
): Observable<Attachment>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment