Merge branch 'main' of https://github.com/vitorpamplona/amethyst
This commit is contained in:
@@ -131,14 +131,14 @@ object MediaSaverToDisk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
saveContentQ(
|
saveContentQ(
|
||||||
displayName = File(url).nameWithoutExtension,
|
displayName = File(trimInlineMetaData(url)).nameWithoutExtension,
|
||||||
contentType = realType,
|
contentType = realType,
|
||||||
contentSource = response.body.source(),
|
contentSource = response.body.source(),
|
||||||
contentResolver = context.contentResolver,
|
contentResolver = context.contentResolver,
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
saveContentDefault(
|
saveContentDefault(
|
||||||
fileName = File(url).name,
|
fileName = File(trimInlineMetaData(url)).name,
|
||||||
contentSource = response.body.source(),
|
contentSource = response.body.source(),
|
||||||
context = context,
|
context = context,
|
||||||
)
|
)
|
||||||
@@ -255,5 +255,7 @@ object MediaSaverToDisk {
|
|||||||
MediaScannerConnection.scanFile(context, arrayOf(outputFile.toString()), null, null)
|
MediaScannerConnection.scanFile(context, arrayOf(outputFile.toString()), null, null)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun trimInlineMetaData(url: String): String = url.substringBefore("#")
|
||||||
|
|
||||||
private const val PICTURES_SUBDIRECTORY = "Amethyst"
|
private const val PICTURES_SUBDIRECTORY = "Amethyst"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user