Omitting the export of empty LOCATION and DESCRIPTION properties in IcsExporter

This commit is contained in:
Chris-GW 2022-11-09 14:54:19 +01:00
parent 25ac85f8a6
commit 90f9a14fbf
No known key found for this signature in database
GPG Key ID: A96C5FC432F8192E

View File

@ -58,7 +58,7 @@ class IcsExporter {
event.eventType.let { out.writeLn("$CATEGORY_COLOR${activity.eventTypesDB.getEventTypeWithId(it)?.color}") }
event.eventType.let { out.writeLn("$CATEGORIES${activity.eventTypesDB.getEventTypeWithId(it)?.title}") }
event.lastUpdated.let { out.writeLn("$LAST_MODIFIED:${Formatter.getExportedTime(it)}") }
event.location.let { out.writeLn("$LOCATION:$it") }
event.location.let { if (it.isNotEmpty()) out.writeLn("$LOCATION:$it") }
event.availability.let { out.writeLn("$TRANSP${if (it == Events.AVAILABILITY_FREE) TRANSPARENT else OPAQUE}") }
if (event.getIsAllDay()) {
@ -138,9 +138,5 @@ class IcsExporter {
isFirstLine = false
index += MAX_LINE_LENGTH
}
if (isFirstLine) {
out.writeLn("$DESCRIPTION$description")
}
}
}