mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-29 22:03:55 +01:00
Handle failures in chunk uploads (#3916)
* Handle failures in chunk uploads * Fix failures * Upload fixed * Handle multiple file upload * Increase request timeout
This commit is contained in:
parent
0d5fa048a5
commit
6c55525a43
8 changed files with 69 additions and 38 deletions
|
|
@ -6,20 +6,20 @@ import fr.free.nrw.commons.upload.UploadResult
|
|||
|
||||
data class ChunkInfo(
|
||||
val uploadResult: UploadResult,
|
||||
val lastChunkIndex: Int,
|
||||
var isLastChunkUploaded: Boolean
|
||||
val indexOfNextChunkToUpload: Int,
|
||||
val totalChunks: Int
|
||||
) : Parcelable {
|
||||
constructor(parcel: Parcel) : this(
|
||||
parcel.readParcelable(UploadResult::class.java.classLoader),
|
||||
parcel.readInt(),
|
||||
parcel.readByte() != 0.toByte()
|
||||
parcel.readInt()
|
||||
) {
|
||||
}
|
||||
|
||||
override fun writeToParcel(parcel: Parcel, flags: Int) {
|
||||
parcel.writeParcelable(uploadResult, flags)
|
||||
parcel.writeInt(lastChunkIndex)
|
||||
parcel.writeByte(if (isLastChunkUploaded) 1 else 0)
|
||||
parcel.writeInt(indexOfNextChunkToUpload)
|
||||
parcel.writeInt(totalChunks)
|
||||
}
|
||||
|
||||
override fun describeContents(): Int {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue