mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:30:43 +00:00
Media: handle PR review remarks
This commit is contained in:
+1
-1
@@ -36,5 +36,5 @@ interface MatrixMediaLoader {
|
||||
* @param mimeType: optional mime type
|
||||
* @return a [Result] of [MediaFile]
|
||||
*/
|
||||
suspend fun loadMediaFile(source: MediaSource, mimeType: String?): Result<MediaFile>
|
||||
suspend fun downloadMediaFile(source: MediaSource, mimeType: String?): Result<MediaFile>
|
||||
}
|
||||
|
||||
+1
-1
@@ -59,7 +59,7 @@ class RustMediaLoader(
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun loadMediaFile(source: MediaSource, mimeType: String?): Result<MediaFile> =
|
||||
override suspend fun downloadMediaFile(source: MediaSource, mimeType: String?): Result<MediaFile> =
|
||||
withContext(dispatchers.io) {
|
||||
runCatching {
|
||||
source.toRustMediaSource().use { mediaSource ->
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ class FakeMediaLoader : MatrixMediaLoader {
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun loadMediaFile(source: MediaSource, mimeType: String?): Result<MediaFile> {
|
||||
override suspend fun downloadMediaFile(source: MediaSource, mimeType: String?): Result<MediaFile> {
|
||||
delay(FAKE_DELAY_IN_MS)
|
||||
return if (shouldFail) {
|
||||
Result.failure(RuntimeException())
|
||||
|
||||
Reference in New Issue
Block a user