Fix media descriptions being wrapped with string

This commit is contained in:
Matthieu 2021-01-25 18:54:55 +01:00
parent 03cf950bab
commit ed1d35b539
2 changed files with 6 additions and 2 deletions

View File

@ -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())

View File

@ -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>