diff --git a/app/src/main/java/io/legado/app/utils/DocumentExtensions.kt b/app/src/main/java/io/legado/app/utils/DocumentExtensions.kt index a9c959549..5e2411706 100644 --- a/app/src/main/java/io/legado/app/utils/DocumentExtensions.kt +++ b/app/src/main/java/io/legado/app/utils/DocumentExtensions.kt @@ -31,7 +31,7 @@ object DocumentUtils { vararg subDirs: String ): DocumentFile? { val parent: DocumentFile? = createFolderIfNotExist(root, *subDirs) - return parent?.createFile(mimeType, fileName) + return parent?.findFile(fileName) ?: parent?.createFile(mimeType, fileName) } fun createFolderIfNotExist(root: DocumentFile, vararg subDirs: String): DocumentFile? {