From 7585d4bbc2bf742bf7e4c33dd6b64f7066e94baf Mon Sep 17 00:00:00 2001 From: Prasad Kamath Date: Mon, 25 Mar 2024 17:52:11 -0400 Subject: [PATCH] Add logs to zip --- .../tracker/utilities/FieldAudioHelper.kt | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/fieldbook/tracker/utilities/FieldAudioHelper.kt b/app/src/main/java/com/fieldbook/tracker/utilities/FieldAudioHelper.kt index b5e0681f7..74174ef8b 100644 --- a/app/src/main/java/com/fieldbook/tracker/utilities/FieldAudioHelper.kt +++ b/app/src/main/java/com/fieldbook/tracker/utilities/FieldAudioHelper.kt @@ -107,8 +107,15 @@ class FieldAudioHelper @Inject constructor(@ActivityContext private val context: ) } - val geoNavLogWriter = context.getGeoNavHelper().getGeoNavLogLimitedUri() - val geoNavFile = geoNavLogWriter?.let { + var geoNavLogWriter = context.getGeoNavHelper().getGeoNavLogLimitedUri() + val limitedGeoNavFile = geoNavLogWriter?.let { + DocumentFile.fromSingleUri(context, + it + ) + } + + geoNavLogWriter = context.getGeoNavHelper().getGeoNavLogFullUri() + val fullGeoNavFile = geoNavLogWriter?.let { DocumentFile.fromSingleUri(context, it ) @@ -116,7 +123,10 @@ class FieldAudioHelper @Inject constructor(@ActivityContext private val context: val paths = ArrayList() paths.add(audioDocumentFile) - paths.add(geoNavFile) + if(limitedGeoNavFile != null) + paths.add(limitedGeoNavFile) + if(fullGeoNavFile != null) + paths.add(fullGeoNavFile) paths.add(traitsDocumentFile) val mGeneratedName = "field_audio_log" + context.cRange.plot_id + "_" + fieldAlias + " " + timeStamp.format(c.time) + ".zip"