sonar fixes

This commit is contained in:
davotoula
2026-03-28 00:23:31 +01:00
parent c5a88bba97
commit 44b8ef5d8f
2 changed files with 6 additions and 2 deletions
@@ -106,7 +106,9 @@ class MediaCompressor {
} catch (e: Exception) {
if (e is CancellationException) throw e
Log.d("MediaCompressor", "Image compression failed: ${e.message}")
tempFile?.delete()
if (tempFile?.delete() == false) {
Log.w("MediaCompressor", "Failed to delete temp file: ${tempFile.absolutePath}")
}
MediaCompressorResult(uri, contentType, null)
}
}
@@ -232,7 +232,9 @@ object VideoCompressionHelper {
// Sanity check: compression not smaller than original
if (originalSize in 1..size) {
File(path).delete()
if (!File(path).delete()) {
Log.w("VideoCompressionHelper", "Failed to delete compressed file: $path")
}
applicationContext.notifyUser(
"Compressed file larger than original. Using original.",
Log.WARN,