forked from github/szkolny
[APIv2/Librus] Show starting points only when greater than 0.
This commit is contained in:
parent
fe40ab0ab4
commit
8f8eb64364
@ -26,6 +26,7 @@ class LibrusApiBehaviourGrades(override val data: DataLibrus,
|
|||||||
init { data.profile?.let { profile ->
|
init { data.profile?.let { profile ->
|
||||||
apiGet(TAG, "BehaviourGrades/Points") { json ->
|
apiGet(TAG, "BehaviourGrades/Points") { json ->
|
||||||
|
|
||||||
|
if (data.startPointsSemester1 > 0) {
|
||||||
val semester1StartGradeObject = Grade(
|
val semester1StartGradeObject = Grade(
|
||||||
profileId,
|
profileId,
|
||||||
-101,
|
-101,
|
||||||
@ -49,7 +50,9 @@ class LibrusApiBehaviourGrades(override val data: DataLibrus,
|
|||||||
true,
|
true,
|
||||||
profile.getSemesterStart(1).inMillis
|
profile.getSemesterStart(1).inMillis
|
||||||
))
|
))
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data.startPointsSemester2 > 0) {
|
||||||
val semester2StartGradeObject = Grade(
|
val semester2StartGradeObject = Grade(
|
||||||
profileId,
|
profileId,
|
||||||
-102,
|
-102,
|
||||||
@ -73,6 +76,7 @@ class LibrusApiBehaviourGrades(override val data: DataLibrus,
|
|||||||
true,
|
true,
|
||||||
profile.getSemesterStart(2).inMillis
|
profile.getSemesterStart(2).inMillis
|
||||||
))
|
))
|
||||||
|
}
|
||||||
|
|
||||||
json.getJsonArray("Grades")?.asJsonObjectList()?.forEach { grade ->
|
json.getJsonArray("Grades")?.asJsonObjectList()?.forEach { grade ->
|
||||||
val id = grade.getLong("Id") ?: return@forEach
|
val id = grade.getLong("Id") ?: return@forEach
|
||||||
|
Loading…
x
Reference in New Issue
Block a user