mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-29 22:03:55 +01:00
Handle errors in chunk uploads (#3899)
This commit is contained in:
parent
1856196851
commit
74720aac19
8 changed files with 99 additions and 14 deletions
|
|
@ -3,21 +3,23 @@ package fr.free.nrw.commons.contributions
|
|||
import android.os.Parcel
|
||||
import android.os.Parcelable
|
||||
import fr.free.nrw.commons.upload.UploadResult
|
||||
import kotlinx.android.parcel.Parcelize
|
||||
|
||||
data class ChunkInfo(
|
||||
val uploadResult: UploadResult,
|
||||
val lastChunkIndex: Int
|
||||
val lastChunkIndex: Int,
|
||||
var isLastChunkUploaded: Boolean
|
||||
) : Parcelable {
|
||||
constructor(parcel: Parcel) : this(
|
||||
parcel.readParcelable(UploadResult::class.java.classLoader),
|
||||
parcel.readInt()
|
||||
parcel.readInt(),
|
||||
parcel.readByte() != 0.toByte()
|
||||
) {
|
||||
}
|
||||
|
||||
override fun writeToParcel(parcel: Parcel, flags: Int) {
|
||||
parcel.writeParcelable(uploadResult, flags)
|
||||
parcel.writeInt(lastChunkIndex)
|
||||
parcel.writeByte(if (isLastChunkUploaded) 1 else 0)
|
||||
}
|
||||
|
||||
override fun describeContents(): Int {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue