mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-21 20:47:03 -05:00
Fix temp chapter files not being able to be created when reading
This commit is contained in:
parent
493da5c3f4
commit
8409ebe4eb
1 changed files with 3 additions and 1 deletions
|
@ -11,9 +11,11 @@ class UniFileTempFileManager(
|
||||||
private val context: Context,
|
private val context: Context,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
private val dir = File(context.externalCacheDir, "tmp").also { it.mkdir() }
|
private val dir = File(context.externalCacheDir, "tmp")
|
||||||
|
|
||||||
fun createTempFile(file: UniFile): File {
|
fun createTempFile(file: UniFile): File {
|
||||||
|
dir.mkdirs()
|
||||||
|
|
||||||
val inputStream = context.contentResolver.openInputStream(file.uri)!!
|
val inputStream = context.contentResolver.openInputStream(file.uri)!!
|
||||||
val tempFile = File.createTempFile(
|
val tempFile = File.createTempFile(
|
||||||
file.nameWithoutExtension.orEmpty().padEnd(3), // Prefix must be 3+ chars
|
file.nameWithoutExtension.orEmpty().padEnd(3), // Prefix must be 3+ chars
|
||||||
|
|
Loading…
Reference in a new issue