mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2024-11-24 19:04:38 -06:00
[API/Librus] Fix timetable with no HourFrom and HourTo.
This commit is contained in:
parent
554097fc7d
commit
37e57d2f73
@ -1671,11 +1671,32 @@ public class Librus implements EdziennikInterface {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Time startTime = null;
|
||||||
|
Time endTime = null;
|
||||||
|
try {
|
||||||
|
startTime = Time.fromH_m(lesson.get(substitution && !cancelled ? "OrgHourFrom" : "HourFrom").getAsString());
|
||||||
|
endTime = Time.fromH_m(lesson.get(substitution && !cancelled ? "OrgHourTo" : "HourTo").getAsString());
|
||||||
|
}
|
||||||
|
catch (Exception ignore) {
|
||||||
|
try {
|
||||||
|
JsonElement lessonNo;
|
||||||
|
if (!((lessonNo = lesson.get("LessonNo")) instanceof JsonNull)) {
|
||||||
|
Pair<Time, Time> timePair = lessonRanges.get(strToInt(lessonNo.getAsString()));
|
||||||
|
if (timePair != null) {
|
||||||
|
startTime = timePair.first;
|
||||||
|
endTime = timePair.second;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ignore2) { }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Lesson lessonObject = new Lesson(
|
Lesson lessonObject = new Lesson(
|
||||||
profileId,
|
profileId,
|
||||||
lesson.get("DayNo").getAsInt() - 1,
|
lesson.get("DayNo").getAsInt() - 1,
|
||||||
Time.fromH_m(lesson.get(substitution && !cancelled ? "OrgHourFrom" : "HourFrom").getAsString()),
|
startTime,
|
||||||
Time.fromH_m(lesson.get(substitution && !cancelled ? "OrgHourTo" : "HourTo").getAsString())
|
endTime
|
||||||
);
|
);
|
||||||
|
|
||||||
JsonElement subject;
|
JsonElement subject;
|
||||||
|
Loading…
Reference in New Issue
Block a user