|
|
|
|
@ -101,7 +101,7 @@ class FavoriteSessionFinder { |
|
|
|
|
*/ |
|
|
|
|
private fun favoriteSession(sessionType: Int, location: Location?, realm: Realm, context: Context) : Session? { |
|
|
|
|
|
|
|
|
|
var lastSessionsQuery = realm.where(Session::class.java).equalTo("type", sessionType) |
|
|
|
|
val lastSessionsQuery = realm.where(Session::class.java).equalTo("type", sessionType) |
|
|
|
|
if (location != null) { |
|
|
|
|
lastSessionsQuery.equalTo("location.id", location.id) |
|
|
|
|
} |
|
|
|
|
@ -110,7 +110,7 @@ class FavoriteSessionFinder { |
|
|
|
|
.limit(FAVORITE_SIGNIFICANT_SESSIONS) |
|
|
|
|
.findAll() |
|
|
|
|
|
|
|
|
|
var counters= hashMapOf<String, Counter>() |
|
|
|
|
val counters= hashMapOf<String, Counter>() |
|
|
|
|
lastSessions.forEach { session -> |
|
|
|
|
val representation = session.parameterRepresentation(context) |
|
|
|
|
val counter = counters[representation] |
|
|
|
|
|