formatting some code

This commit is contained in:
tibbi
2021-07-06 14:14:59 +02:00
parent af02ad76e5
commit d2be7701f0

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 // 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) { if (eventToUpdate != null && eventToUpdate.lastUpdated >= curLastModified) {
eventsAlreadyExist++ eventsAlreadyExist++
line = curLine line = curLine
@@ -193,9 +194,32 @@ class IcsImporter(val activity: SimpleActivity) {
val eventType = eventTypes.firstOrNull { it.id == curEventTypeId } val eventType = eventTypes.firstOrNull { it.id == curEventTypeId }
val source = if (calDAVCalendarId == 0 || eventType?.isSyncedEventType() == false) SOURCE_IMPORTED_ICS else "$CALDAV-$calDAVCalendarId" 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, val event = Event(
reminders[1].minutes, reminders[2].minutes, reminders[0].type, reminders[1].type, reminders[2].type, curRepeatInterval, curRepeatRule, null,
curRepeatLimit, curRepeatExceptions, "", curImportId, DateTimeZone.getDefault().id, curFlags, curEventTypeId, 0, curLastModified, source) 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) { if (event.getIsAllDay() && curEnd > curStart) {
event.endTS -= DAY event.endTS -= DAY