mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
formatting some code
This commit is contained in:
@@ -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
|
||||||
|
Reference in New Issue
Block a user