Do something with the "Boolean" value returned by "delete".

This commit is contained in:
davotoula
2026-01-15 14:00:13 +01:00
parent 76a05f7d71
commit 835fbb90b7
@@ -109,8 +109,11 @@ class VoiceAnonymizationController(
distortedFiles.values.forEach { result ->
try {
if (result.file.exists()) {
result.file.delete()
Log.d(logTag, "Deleted distorted file: ${result.file.absolutePath}")
if (result.file.delete()) {
Log.d(logTag, "Deleted distorted file: ${result.file.absolutePath}")
} else {
Log.w(logTag, "Failed to delete distorted file: ${result.file.absolutePath}")
}
}
} catch (e: Exception) {
Log.w(logTag, "Failed to delete distorted file: ${result.file.absolutePath}", e)