don't try to back up directories matching the file name patterns

fixes #1653
This commit is contained in:
Helium314 2025-06-02 17:36:06 +02:00
parent 20d4704090
commit d951a1dbdd

View file

@ -67,7 +67,7 @@ fun BackupRestorePreference(setting: Setting) {
val files = mutableListOf<File>()
filesDir.walk().forEach { file ->
val path = file.path.replace(filesPath, "")
if (backupFilePatterns.any { path.matches(it) })
if (file.isFile && backupFilePatterns.any { path.matches(it) })
files.add(file)
}
val protectedFilesDir = DeviceProtectedUtils.getFilesDir(ctx)
@ -75,7 +75,7 @@ fun BackupRestorePreference(setting: Setting) {
val protectedFiles = mutableListOf<File>()
protectedFilesDir.walk().forEach { file ->
val path = file.path.replace(protectedFilesPath, "")
if (backupFilePatterns.any { path.matches(it) })
if (file.isFile && backupFilePatterns.any { path.matches(it) })
protectedFiles.add(file)
}
val wait = CountDownLatch(1)