mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-10-10 10:43:34 +02:00
Merge pull request #1377 from davotoula/strip-codec-from-mime-type-before-saving-video
bugfix: only user part before ";" in media-type before passing to ContentResolver
This commit is contained in:
@@ -201,10 +201,11 @@ object MediaSaverToDisk {
|
||||
contentSource: BufferedSource,
|
||||
contentResolver: ContentResolver,
|
||||
) {
|
||||
val cleanMimeType = contentType.substringBefore(";").trim()
|
||||
val contentValues =
|
||||
ContentValues().apply {
|
||||
put(MediaStore.MediaColumns.DISPLAY_NAME, displayName)
|
||||
put(MediaStore.MediaColumns.MIME_TYPE, contentType)
|
||||
put(MediaStore.MediaColumns.MIME_TYPE, cleanMimeType)
|
||||
put(
|
||||
MediaStore.MediaColumns.RELATIVE_PATH,
|
||||
Environment.DIRECTORY_PICTURES + File.separatorChar + PICTURES_SUBDIRECTORY,
|
||||
|
Reference in New Issue
Block a user