formatting some code

This commit is contained in:
tibbi 2021-07-06 14:14:59 +02:00
parent af02ad76e5
commit d2be7701f0
1 changed files with 28 additions and 4 deletions

View File

@ -176,7 +176,8 @@ class IcsImporter(val activity: SimpleActivity) {
}
// repeating event exceptions can have the same import id as their parents, so pick the latest event to update
val eventToUpdate = existingEvents.filter { curImportId.isNotEmpty() && curImportId == it.importId }.sortedByDescending { it.lastUpdated }.firstOrNull()
val eventToUpdate =
existingEvents.filter { curImportId.isNotEmpty() && curImportId == it.importId }.sortedByDescending { it.lastUpdated }.firstOrNull()
if (eventToUpdate != null && eventToUpdate.lastUpdated >= curLastModified) {
eventsAlreadyExist++
line = curLine
@ -193,9 +194,32 @@ class IcsImporter(val activity: SimpleActivity) {
val eventType = eventTypes.firstOrNull { it.id == curEventTypeId }
val source = if (calDAVCalendarId == 0 || eventType?.isSyncedEventType() == false) SOURCE_IMPORTED_ICS else "$CALDAV-$calDAVCalendarId"
val event = Event(null, curStart, curEnd, curTitle, curLocation, curDescription, reminders[0].minutes,
reminders[1].minutes, reminders[2].minutes, reminders[0].type, reminders[1].type, reminders[2].type, curRepeatInterval, curRepeatRule,
curRepeatLimit, curRepeatExceptions, "", curImportId, DateTimeZone.getDefault().id, curFlags, curEventTypeId, 0, curLastModified, source)
val event = Event(
null,
curStart,
curEnd,
curTitle,
curLocation,
curDescription,
reminders[0].minutes,
reminders[1].minutes,
reminders[2].minutes,
reminders[0].type,
reminders[1].type,
reminders[2].type,
curRepeatInterval,
curRepeatRule,
curRepeatLimit,
curRepeatExceptions,
"",
curImportId,
DateTimeZone.getDefault().id,
curFlags,
curEventTypeId,
0,
curLastModified,
source
)
if (event.getIsAllDay() && curEnd > curStart) {
event.endTS -= DAY