Distinct students by symbol in hybrid login

This commit is contained in:
Mikołaj Pich 2020-03-02 20:52:03 +01:00
parent 3182d77633
commit 1f7fab1740
No known key found for this signature in database
GPG key ID: F62B26E36D4C4BAA

View file

@ -193,7 +193,7 @@ class Sdk {
fun getStudentsHybrid(email: String, password: String, scrapperBaseUrl: String, startSymbol: String = "Default", apiKey: String = ""): Single<List<Student>> {
return getStudentsFromScrapper(email, password, scrapperBaseUrl, startSymbol)
.compose(ScrapperExceptionTransformer())
.map { students -> students.distinctBy { it.schoolSymbol } }
.map { students -> students.distinctBy { it.symbol } }
.flatMapObservable { Observable.fromIterable(it) }
.flatMapSingle { scrapperStudent ->
scrapper.let {