From 41a233d1757f7644179563a1a01c2af1bc7c42f7 Mon Sep 17 00:00:00 2001 From: davotoula Date: Mon, 22 Sep 2025 22:54:37 +0200 Subject: [PATCH] fix for library bug. Temp file name with "_temp" is returned instead of final file name --- .../amethyst/service/uploads/VideoCompressionHelper.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/uploads/VideoCompressionHelper.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/uploads/VideoCompressionHelper.kt index e622c798e..3153797b5 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/uploads/VideoCompressionHelper.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/uploads/VideoCompressionHelper.kt @@ -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), ) } }