Merge pull request #1298 from davotoula/1297-trim-inline-meta-data-before-saving-file
Trim meta data from file name before saving file to disk
This commit is contained in:
@@ -131,14 +131,14 @@ object MediaSaverToDisk {
|
||||
}
|
||||
|
||||
saveContentQ(
|
||||
displayName = File(url).nameWithoutExtension,
|
||||
displayName = File(trimInlineMetaData(url)).nameWithoutExtension,
|
||||
contentType = realType,
|
||||
contentSource = response.body.source(),
|
||||
contentResolver = context.contentResolver,
|
||||
)
|
||||
} else {
|
||||
saveContentDefault(
|
||||
fileName = File(url).name,
|
||||
fileName = File(trimInlineMetaData(url)).name,
|
||||
contentSource = response.body.source(),
|
||||
context = context,
|
||||
)
|
||||
@@ -255,5 +255,7 @@ object MediaSaverToDisk {
|
||||
MediaScannerConnection.scanFile(context, arrayOf(outputFile.toString()), null, null)
|
||||
}
|
||||
|
||||
private fun trimInlineMetaData(url: String): String = url.substringBefore("#")
|
||||
|
||||
private const val PICTURES_SUBDIRECTORY = "Amethyst"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user