@@ -20,6 +20,7 @@ import com.fieldbook.tracker.database.withDatabase
2020import com.fieldbook.tracker.objects.RangeObject
2121import com.fieldbook.tracker.objects.TraitObject
2222import com.fieldbook.tracker.preferences.GeneralKeys
23+ import com.fieldbook.tracker.traits.formats.presenters.UriPresenter
2324import com.fieldbook.tracker.utilities.CategoryJsonUtil
2425import com.fieldbook.tracker.utilities.export.ValueProcessorFormatAdapter
2526
@@ -141,7 +142,7 @@ class ObservationUnitPropertyDao {
141142
142143 Log .d(" getExportDbData" , " Final Query: $query " )
143144 val table = db.rawQuery(query, null ).toTable()
144-
145+ val attachedMediaUriPresenter = UriPresenter ()
145146 table.forEach { row ->
146147 cursor.addRow(fieldList.map { row[it] } + traitRequiredFields.map {
147148 when (it) {
@@ -158,9 +159,9 @@ class ObservationUnitPropertyDao {
158159 " person" -> row[" collector" ]
159160 " location" -> row[" geo_coordinates" ]
160161 " rep" -> row[" rep" ]
161- " photo_uri" -> row[" photo_uri" ]
162- " video_uri" -> row[" video_uri" ]
163- " audio_uri" -> row[" audio_uri" ]
162+ " photo_uri" -> ( row[" photo_uri" ] as ? String )?. takeIf { it.isNotEmpty() }?. let { attachedMediaUriPresenter.represent(context, it) } ? : " "
163+ " video_uri" -> ( row[" video_uri" ] as ? String )?. takeIf { it.isNotEmpty() }?. let { attachedMediaUriPresenter.represent(context, it) } ? : " "
164+ " audio_uri" -> ( row[" audio_uri" ] as ? String )?. takeIf { it.isNotEmpty() }?. let { attachedMediaUriPresenter.represent(context, it) } ? : " "
164165 else -> String ()
165166 }
166167 })
0 commit comments