fix some ics importing related glitches

This commit is contained in:
tibbi 2021-03-12 09:43:34 +01:00
parent 43147df0aa
commit ce134aad28
1 changed files with 3 additions and 0 deletions

View File

@ -166,6 +166,7 @@ class IcsImporter(val activity: SimpleActivity) {
} }
if (curTitle.isEmpty() || curStart == -1L) { if (curTitle.isEmpty() || curStart == -1L) {
line = curLine
continue continue
} }
@ -173,6 +174,7 @@ class IcsImporter(val activity: SimpleActivity) {
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
continue continue
} }
@ -198,6 +200,7 @@ class IcsImporter(val activity: SimpleActivity) {
event.importId = event.hashCode().toString() event.importId = event.hashCode().toString()
if (existingEvents.map { it.importId }.contains(event.importId)) { if (existingEvents.map { it.importId }.contains(event.importId)) {
eventsAlreadyExist++ eventsAlreadyExist++
line = curLine
continue continue
} }
} }