Merge branch 'posting_fix' into 'master'
Fix multi upload See merge request pixeldroid/PixelDroid!300
This commit is contained in:
commit
6084ecda89
|
@ -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>
|
||||
|
||||
|
|
Loading…
Reference in New Issue