Do not re-import tasks if they already exists!

This commit is contained in:
Naveen 2023-01-15 19:17:21 +05:30
parent c70458ec20
commit 908241cb63
2 changed files with 3 additions and 3 deletions

View File

@ -67,7 +67,7 @@ class IcsImporter(val activity: SimpleActivity) {
): ImportResult {
try {
val eventTypes = eventsHelper.getEventTypesSync()
val existingEvents = activity.eventsDB.getEventsWithImportIds().toMutableList() as ArrayList<Event>
val existingEvents = activity.eventsDB.getEventsOrTasksWithImportIds().toMutableList() as ArrayList<Event>
val eventsToInsert = ArrayList<Event>()
var line = ""

View File

@ -72,8 +72,8 @@ interface EventsDao {
@Query("SELECT * FROM events WHERE source = \'$SOURCE_CONTACT_ANNIVERSARY\' AND type = $TYPE_EVENT")
fun getAnniversaries(): List<Event>
@Query("SELECT * FROM events WHERE import_id != \"\" AND type = $TYPE_EVENT")
fun getEventsWithImportIds(): List<Event>
@Query("SELECT * FROM events WHERE import_id != \"\"")
fun getEventsOrTasksWithImportIds(): List<Event>
@Query("SELECT * FROM events WHERE source = :source AND type = $TYPE_EVENT")
fun getEventsFromCalDAVCalendar(source: String): List<Event>