[APIv2/Vulcan] Update uonet-request-signer. Update removing profile. Fix minor issues.

This commit is contained in:
Kuba Szczodrzyński 2019-11-01 22:30:39 +01:00
parent e3bb607303
commit 64019dccf7
5 changed files with 11 additions and 4 deletions

View File

@ -161,7 +161,7 @@ dependencies {
implementation "org.redundent:kotlin-xml-builder:1.5.3"
implementation "io.github.wulkanowy:signer-android:0.1.0"
implementation "io.github.wulkanowy:signer-android:0.1.1"
}
repositories {
mavenCentral()

View File

@ -40,7 +40,7 @@ open class VulcanApi(open val data: DataVulcan) {
d(tag, "Request: Vulcan/Api - $url")
if (data.teamList.size() == 0) {
data.profile?.getStudentData("studentClassName", null)?.also { name ->
data.profile?.studentClassName?.also { name ->
val id = Utils.crc16(name.toByteArray()).toLong()
val teamObject = Team(

View File

@ -63,7 +63,7 @@ class VulcanApiEvents(override val data: DataVulcan, private val isHomework: Boo
else -> Event.TYPE_EXAM
}
}
val teamId = event.getLong("IdOddzial") ?: data.teamClass?.id ?: return@forEach
val teamId = event.getLong("IdOddzial") ?: data.teamClass?.id ?: -1
val eventObject = Event(
profileId,

View File

@ -44,7 +44,7 @@ class VulcanFirstLogin(val data: DataVulcan, val onSuccess: () -> Unit) {
val studentId = student.getInt("Id") ?: return@forEach
val studentLoginId = student.getInt("UzytkownikLoginId") ?: return@forEach
val studentClassId = student.getInt("IdOddzial") ?: return@forEach
val studentClassName = student.getString("OkresPoziom").toString() + student.getString("OddzialSymbol")
val studentClassName = student.getString("OkresPoziom").toString() + (student.getString("OddzialSymbol") ?: return@forEach)
val studentSemesterId = student.getInt("IdOkresKlasyfikacyjny") ?: return@forEach
val studentFirstName = student.getString("Imie") ?: ""
val studentLastName = student.getString("Nazwisko") ?: ""

View File

@ -1161,6 +1161,13 @@ public class Edziennik {
app.db.teamDao().clear(profileId);
app.db.messageRecipientDao().clear(profileId);
app.db.messageDao().clear(profileId);
app.db.endpointTimerDao().clear(profileId);
app.db.attendanceTypeDao().clear(profileId);
app.db.classroomDao().clear(profileId);
app.db.lessonRangeDao().clear(profileId);
app.db.noticeTypeDao().clear(profileId);
app.db.teacherAbsenceDao().clear(profileId);
app.db.teacherAbsenceTypeDao().clear(profileId);
int loginStoreId = profileObject.getLoginStoreId();
List<Integer> profilesUsingLoginStore = app.db.profileDao().getIdsByLoginStoreIdNow(loginStoreId);