fix: Delete custom saveFolder files after recording if enabled

This commit is contained in:
Myzel394 2023-11-19 18:36:02 +01:00
parent d0701868cf
commit 89ac35e92e
No known key found for this signature in database
GPG Key ID: 79CC92F37B3E1A2B
2 changed files with 7 additions and 0 deletions

View File

@ -133,6 +133,9 @@ data class BatchesFolder(
when (type) {
BatchType.INTERNAL -> getInternalFolder().deleteRecursively()
BatchType.CUSTOM -> customFolder?.findFile(subfolderName)?.delete()
?: customFolder?.findFile(subfolderName)?.listFiles()?.forEach {
it.delete()
}
}
}

View File

@ -157,6 +157,10 @@ fun AudioRecorderScreen(
BatchesFolder.BatchType.CUSTOM -> {
showSnackbar(audioRecorder.batchesFolder!!.customFolder!!.uri)
if (settings.audioRecorderSettings.deleteRecordingsImmediately) {
audioRecorder.batchesFolder!!.deleteRecordings()
}
}
}
} catch (error: Exception) {