avoid exporting the same event twice

This commit is contained in:
tibbi 2017-04-03 23:34:31 +02:00
parent e97800cf8a
commit a76f61b5e7
1 changed files with 2 additions and 1 deletions

View File

@ -437,7 +437,7 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont
fun getEventsToExport(includePast: Boolean): ArrayList<Event> {
val currTime = (System.currentTimeMillis() / 1000).toString()
val events = ArrayList<Event>()
var events = ArrayList<Event>()
// non repeating events
var cursor = if (includePast) {
@ -457,6 +457,7 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont
events.addAll(fillEvents(cursor))
}
events = events.distinctBy { it.id } as ArrayList<Event>
return events
}