|
|
|
@ -102,7 +102,7 @@ class FavoriteSessionFinder { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
fun favoriteSession(sessionType: Int, location: Location?, realm: Realm, context: Context): Session? { |
|
|
|
fun favoriteSession(sessionType: Int, location: Location?, realm: Realm, context: Context): Session? { |
|
|
|
|
|
|
|
|
|
|
|
val lastSessionsQuery = realm.where(Session::class.java).isNotNull("endDate").equalTo("type", sessionType) |
|
|
|
val lastSessionsQuery = realm.where(Session::class.java).isNotNull("startDate").equalTo("type", sessionType) |
|
|
|
if (location != null) { |
|
|
|
if (location != null) { |
|
|
|
lastSessionsQuery.equalTo("location.id", location.id) |
|
|
|
lastSessionsQuery.equalTo("location.id", location.id) |
|
|
|
} |
|
|
|
} |
|
|
|
|