fix for library bug. Temp file name with "_temp" is returned instead of final file name

This commit is contained in:
davotoula
2025-09-22 22:54:37 +02:00
parent b6dd6a988b
commit 41a233d175

View File

@@ -270,9 +270,16 @@ class VideoCompressionHelper {
"Compressed [$size] ($reductionPercent% reduction)",
)
// Attempt to correct the path: if it contains "_temp" then remove it
val correctedPath =
if (path.contains("_temp")) {
path.replace("_temp", "")
} else {
path
}
if (continuation.isActive) {
continuation.resume(
MediaCompressorResult(Uri.fromFile(File(path)), contentType, size),
MediaCompressorResult(Uri.fromFile(File(correctedPath)), contentType, size),
)
}
}