fix some event duplication in sequences
This commit is contained in:
parent
9b4be2717e
commit
9258fd4ad2
|
@ -141,7 +141,8 @@ class IcsImporter(val activity: SimpleActivity) {
|
|||
continue
|
||||
}
|
||||
|
||||
val eventToUpdate = existingEvents.firstOrNull { curImportId.isNotEmpty() && curImportId == it.importId }
|
||||
// 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()
|
||||
if (eventToUpdate != null && eventToUpdate.lastUpdated >= curLastModified) {
|
||||
continue
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue