From 8409ebe4ebbde0957aec122e11acae65ebda78e2 Mon Sep 17 00:00:00 2001 From: arkon Date: Fri, 5 Jan 2024 15:48:56 -0500 Subject: [PATCH] Fix temp chapter files not being able to be created when reading --- .../java/tachiyomi/core/storage/UniFileTempFileManager.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/tachiyomi/core/storage/UniFileTempFileManager.kt b/core/src/main/java/tachiyomi/core/storage/UniFileTempFileManager.kt index 938494613..0aa9f4b85 100644 --- a/core/src/main/java/tachiyomi/core/storage/UniFileTempFileManager.kt +++ b/core/src/main/java/tachiyomi/core/storage/UniFileTempFileManager.kt @@ -11,9 +11,11 @@ class UniFileTempFileManager( 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 { + dir.mkdirs() + val inputStream = context.contentResolver.openInputStream(file.uri)!! val tempFile = File.createTempFile( file.nameWithoutExtension.orEmpty().padEnd(3), // Prefix must be 3+ chars