mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
Rename withDefaultSubtype to ensureDefaultSubtype
The old name read as though the default subtype always replaced whatever the receiver carried, when a mime type that already has a concrete subtype is returned untouched.
This commit is contained in:
+2
-2
@@ -11,7 +11,7 @@ package io.element.android.libraries.matrix.impl.media
|
||||
import io.element.android.libraries.core.coroutine.CoroutineDispatchers
|
||||
import io.element.android.libraries.core.extensions.mapFailure
|
||||
import io.element.android.libraries.core.extensions.runCatchingExceptions
|
||||
import io.element.android.libraries.core.mimetype.MimeTypes.withDefaultSubtype
|
||||
import io.element.android.libraries.core.mimetype.MimeTypes.ensureDefaultSubtype
|
||||
import io.element.android.libraries.matrix.api.media.MatrixMediaLoader
|
||||
import io.element.android.libraries.matrix.api.media.MediaFile
|
||||
import io.element.android.libraries.matrix.api.media.MediaSource
|
||||
@@ -72,7 +72,7 @@ class RustMediaLoader(
|
||||
mediaSource = mediaSource,
|
||||
filename = filename,
|
||||
// Fallback to a default mime type based on the main type, so that the SDK can create a file with the correct extension.
|
||||
mimeType = mimeType.withDefaultSubtype(),
|
||||
mimeType = mimeType.ensureDefaultSubtype(),
|
||||
useCache = useCache,
|
||||
tempDir = cacheDirectory.path,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user