forked from github/szkolny
[API/DataRemoveModel] Make DAO not remove TYPE_NO_LESSON entries.
This commit is contained in:
parent
ff0de8afc2
commit
0227762ddc
@ -38,11 +38,11 @@ interface TimetableDao {
|
|||||||
@Query("DELETE FROM timetable WHERE profileId = :profileId")
|
@Query("DELETE FROM timetable WHERE profileId = :profileId")
|
||||||
fun clear(profileId: Int)
|
fun clear(profileId: Int)
|
||||||
|
|
||||||
@Query("DELETE FROM timetable WHERE profileId = :profileId AND ((type != 3 AND date >= :dateFrom) OR ((type = 3 OR type = 1) AND oldDate >= :dateFrom))")
|
@Query("DELETE FROM timetable WHERE profileId = :profileId AND type != -1 AND ((type != 3 AND date >= :dateFrom) OR ((type = 3 OR type = 1) AND oldDate >= :dateFrom))")
|
||||||
fun clearFromDate(profileId: Int, dateFrom: Date)
|
fun clearFromDate(profileId: Int, dateFrom: Date)
|
||||||
@Query("DELETE FROM timetable WHERE profileId = :profileId AND ((type != 3 AND date <= :dateTo) OR ((type = 3 OR type = 1) AND oldDate <= :dateTo))")
|
@Query("DELETE FROM timetable WHERE profileId = :profileId AND type != -1 AND ((type != 3 AND date <= :dateTo) OR ((type = 3 OR type = 1) AND oldDate <= :dateTo))")
|
||||||
fun clearToDate(profileId: Int, dateTo: Date)
|
fun clearToDate(profileId: Int, dateTo: Date)
|
||||||
@Query("DELETE FROM timetable WHERE profileId = :profileId AND ((type != 3 AND date >= :dateFrom AND date <= :dateTo) OR ((type = 3 OR type = 1) AND oldDate >= :dateFrom AND oldDate <= :dateTo))")
|
@Query("DELETE FROM timetable WHERE profileId = :profileId AND type != -1 AND ((type != 3 AND date >= :dateFrom AND date <= :dateTo) OR ((type = 3 OR type = 1) AND oldDate >= :dateFrom AND oldDate <= :dateTo))")
|
||||||
fun clearBetweenDates(profileId: Int, dateFrom: Date, dateTo: Date)
|
fun clearBetweenDates(profileId: Int, dateFrom: Date, dateTo: Date)
|
||||||
|
|
||||||
@Query("""
|
@Query("""
|
||||||
|
@ -173,7 +173,7 @@ class TimetableDayFragment : Fragment(), CoroutineScope {
|
|||||||
}
|
}
|
||||||
dayView.setHourLabelViews(hourLabelViews)
|
dayView.setHourLabelViews(hourLabelViews)
|
||||||
|
|
||||||
buildLessonViews(lessons, events)
|
buildLessonViews(lessons.filter { it.type != Lesson.TYPE_NO_LESSONS }, events)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun buildLessonViews(lessons: List<LessonFull>, events: List<EventFull>) {
|
private fun buildLessonViews(lessons: List<LessonFull>, events: List<EventFull>) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user