diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/EventsHelper.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/EventsHelper.kt index 0c6971df0..d868124eb 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/EventsHelper.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/EventsHelper.kt @@ -255,13 +255,13 @@ class EventsHelper(val context: Context) { callback(ArrayList()) return } else { - eventsDB.getEventsFromToWithTypes(toTS, fromTS, context.config.getDisplayEventTypessAsList()).toMutableList() as ArrayList + eventsDB.getOneTimeEventsFromToWithTypes(toTS, fromTS, context.config.getDisplayEventTypessAsList()).toMutableList() as ArrayList } } else { if (eventId == -1L) { - eventsDB.getEventsFromTo(toTS, fromTS).toMutableList() as ArrayList + eventsDB.getOneTimeEventsFromTo(toTS, fromTS).toMutableList() as ArrayList } else { - eventsDB.getEventFromToWithId(eventId, toTS, fromTS).toMutableList() as ArrayList + eventsDB.getOneTimeEventFromToWithId(eventId, toTS, fromTS).toMutableList() as ArrayList } } diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/interfaces/EventsDao.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/interfaces/EventsDao.kt index c6e26a42d..a078fcf1f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/interfaces/EventsDao.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/interfaces/EventsDao.kt @@ -17,14 +17,14 @@ interface EventsDao { @Query("SELECT * FROM events WHERE id = :id") fun getEventWithId(id: Long): Event? - @Query("SELECT * FROM events WHERE start_ts <= :toTS AND end_ts >= :fromTS") - fun getEventsFromTo(toTS: Long, fromTS: Long): List + @Query("SELECT * FROM events WHERE start_ts <= :toTS AND end_ts >= :fromTS AND repeat_interval = 0") + fun getOneTimeEventsFromTo(toTS: Long, fromTS: Long): List - @Query("SELECT * FROM events WHERE id = :id AND start_ts <= :toTS AND end_ts >= :fromTS") - fun getEventFromToWithId(id: Long, toTS: Long, fromTS: Long): List + @Query("SELECT * FROM events WHERE id = :id AND start_ts <= :toTS AND end_ts >= :fromTS AND repeat_interval = 0") + fun getOneTimeEventFromToWithId(id: Long, toTS: Long, fromTS: Long): List - @Query("SELECT * FROM events WHERE start_ts <= :toTS AND end_ts >= :fromTS AND start_ts != 0 AND event_type IN (:eventTypeIds)") - fun getEventsFromToWithTypes(toTS: Long, fromTS: Long, eventTypeIds: List): List + @Query("SELECT * FROM events WHERE start_ts <= :toTS AND end_ts >= :fromTS AND start_ts != 0 AND repeat_interval = 0 AND event_type IN (:eventTypeIds)") + fun getOneTimeEventsFromToWithTypes(toTS: Long, fromTS: Long, eventTypeIds: List): List @Query("SELECT * FROM events WHERE id IN (:ids) AND import_id != \"\"") fun getEventsByIdsWithImportIds(ids: List): List