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
|
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
|
postSub = inter
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
@ -302,7 +306,7 @@ class PostCreationActivity : BaseActivity() {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
data.progress = 100
|
data.progress = 100
|
||||||
if(photoData.all{it.progress == 100}){
|
if(photoData.all{it.progress == 100 && it.uploadId != null}){
|
||||||
binding.uploadProgressBar.visibility = View.GONE
|
binding.uploadProgressBar.visibility = View.GONE
|
||||||
binding.uploadCompletedTextview.visibility = View.VISIBLE
|
binding.uploadCompletedTextview.visibility = View.VISIBLE
|
||||||
post()
|
post()
|
||||||
|
@ -256,7 +256,7 @@ interface PixelfedAPI {
|
|||||||
fun mediaUpload(
|
fun mediaUpload(
|
||||||
//The authorization header needs to be of the form "Bearer <token>"
|
//The authorization header needs to be of the form "Bearer <token>"
|
||||||
@Header("Authorization") authorization: String,
|
@Header("Authorization") authorization: String,
|
||||||
@Part("description") description: String?,
|
@Part description: MultipartBody.Part? = null,
|
||||||
@Part file: MultipartBody.Part
|
@Part file: MultipartBody.Part
|
||||||
): Observable<Attachment>
|
): Observable<Attachment>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user