Use NetworkResult in MediaUploadApi (#2577)

This commit is contained in:
tobi 2022-06-06 16:04:33 +02:00 committed by GitHub
parent e1c8461423
commit 530eb61505
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -23,6 +23,7 @@ import android.util.Log
import android.webkit.MimeTypeMap import android.webkit.MimeTypeMap
import androidx.core.content.FileProvider import androidx.core.content.FileProvider
import androidx.core.net.toUri import androidx.core.net.toUri
import at.connyduck.calladapter.networkresult.getOrThrow
import com.keylesspalace.tusky.BuildConfig import com.keylesspalace.tusky.BuildConfig
import com.keylesspalace.tusky.R import com.keylesspalace.tusky.R
import com.keylesspalace.tusky.components.compose.ComposeActivity.QueuedMedia import com.keylesspalace.tusky.components.compose.ComposeActivity.QueuedMedia

View file

@ -1,5 +1,6 @@
package com.keylesspalace.tusky.network package com.keylesspalace.tusky.network
import at.connyduck.calladapter.networkresult.NetworkResult
import com.keylesspalace.tusky.entity.MediaUploadResult import com.keylesspalace.tusky.entity.MediaUploadResult
import okhttp3.MultipartBody import okhttp3.MultipartBody
import retrofit2.http.Multipart import retrofit2.http.Multipart
@ -15,5 +16,5 @@ interface MediaUploadApi {
suspend fun uploadMedia( suspend fun uploadMedia(
@Part file: MultipartBody.Part, @Part file: MultipartBody.Part,
@Part description: MultipartBody.Part? = null @Part description: MultipartBody.Part? = null
): Result<MediaUploadResult> ): NetworkResult<MediaUploadResult>
} }