[APIv2/Timetable] Add lesson change metadata only when the lesson is today or in the future

This commit is contained in:
Kacper Ziubryniewicz 2019-11-23 22:40:20 +01:00
parent cd76f99bbf
commit 59fcb0a050
4 changed files with 5 additions and 5 deletions

View File

@ -153,7 +153,7 @@ class IdziennikWebTimetable(override val data: DataIdziennik,
dates.add(lessonDate.value)
lessons.add(lessonObject)
if (lessonObject.type != Lesson.TYPE_NORMAL) {
if (lessonObject.type != Lesson.TYPE_NORMAL && lessonDate >= Date.getToday()) {
data.metadataList.add(Metadata(
profileId,
Metadata.TYPE_LESSON_CHANGE,

View File

@ -184,7 +184,7 @@ class LibrusApiTimetables(override val data: DataLibrus,
}
}
if (lessonObject.type != Lesson.TYPE_NORMAL) {
if (lessonObject.type != Lesson.TYPE_NORMAL && lessonDate >= Date.getToday()) {
data.metadataList.add(
Metadata(
data.profileId,

View File

@ -75,7 +75,7 @@ class MobidziennikApiTimetable(val data: DataMobidziennik, rows: List<String>) {
}
}
if (it.type != Lesson.TYPE_NORMAL) {
if (it.type != Lesson.TYPE_NORMAL && date >= Date.getToday()) {
data.metadataList.add(
Metadata(
data.profileId,
@ -195,4 +195,4 @@ class MobidziennikApiTimetable(val data: DataMobidziennik, rows: List<String>) {
}
}*/
}
}
}

View File

@ -172,7 +172,7 @@ class VulcanApiTimetable(override val data: DataVulcan, val onSuccess: () -> Uni
}
}
if (type != Lesson.TYPE_NORMAL) {
if (type != Lesson.TYPE_NORMAL && lessonDate >= Date.getToday()) {
data.metadataList.add(Metadata(
profileId,
Metadata.TYPE_LESSON_CHANGE,