mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
Fix other API change: body renamed to filename
This commit is contained in:
committed by
Benoit Marty
parent
6a1ef6d6f7
commit
c1c9f53015
+2
-2
@@ -25,14 +25,14 @@ interface MatrixMediaLoader {
|
||||
/**
|
||||
* @param source to fetch the data for.
|
||||
* @param mimeType: optional mime type.
|
||||
* @param body: optional body which will be used to name the file.
|
||||
* @param filename: optional String which will be used to name the file.
|
||||
* @param useCache: if true, the rust sdk will cache the media in its store.
|
||||
* @return a [Result] of [MediaFile]
|
||||
*/
|
||||
suspend fun downloadMediaFile(
|
||||
source: MediaSource,
|
||||
mimeType: String?,
|
||||
body: String?,
|
||||
filename: String?,
|
||||
useCache: Boolean = true,
|
||||
): Result<MediaFile>
|
||||
}
|
||||
|
||||
+2
-2
@@ -63,7 +63,7 @@ class RustMediaLoader(
|
||||
override suspend fun downloadMediaFile(
|
||||
source: MediaSource,
|
||||
mimeType: String?,
|
||||
body: String?,
|
||||
filename: String?,
|
||||
useCache: Boolean,
|
||||
): Result<MediaFile> =
|
||||
withContext(mediaDispatcher) {
|
||||
@@ -71,7 +71,7 @@ class RustMediaLoader(
|
||||
source.toRustMediaSource().use { mediaSource ->
|
||||
val mediaFile = innerClient.getMediaFile(
|
||||
mediaSource = mediaSource,
|
||||
body = body,
|
||||
filename = filename,
|
||||
mimeType = mimeType?.takeIf { MimeTypes.hasSubtype(it) } ?: MimeTypes.OctetStream,
|
||||
useCache = useCache,
|
||||
tempDir = cacheDirectory.path,
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ class FakeMatrixMediaLoader : MatrixMediaLoader {
|
||||
override suspend fun downloadMediaFile(
|
||||
source: MediaSource,
|
||||
mimeType: String?,
|
||||
body: String?,
|
||||
filename: String?,
|
||||
useCache: Boolean,
|
||||
): Result<MediaFile> = simulateLongTask {
|
||||
if (shouldFail) {
|
||||
|
||||
Reference in New Issue
Block a user