override fun getVideoGamesRepository(platformName: String) {
gameRepo = VideoGameRepositoryImpl()
compositeDisposable.add(gameRepo.returnVideoGames()
.filter { gameModel -> gameModel.gamesResults.map { } }
.subscribe())
}
Вот метод, который я имею для фильтрации данных из API. Я включу фрагмент данных только для того, что имеет отношение к делу.
Я пытаюсь сравнить значение имени платформы в базе данных с именем платформы, которое я ввел в предыдущем действии. Но .map подчеркнут красным на .map внутри фильтра.
{
"count": 363773,
"next": "https://api.rawg.io/api/games?page=3",
"previous": "https://api.rawg.io/api/games",
"results": [
{
"id": 28,
"slug": "red-dead-redemption-2",
"name": "Red Dead Redemption 2",
"released": "2018-10-26",
"tba": false,
"background_image": "https://media.rawg.io/media/games/511/5118aff5091cb3efec399c808f8c598f.jpg",
"rating": 4.54,
"rating_top": 5,
"ratings": [
{
"id": 5,
"title": "exceptional",
"count": 1466,
"percent": 70.28
},
{
"id": 4,
"title": "recommended",
"count": 409,
"percent": 19.61
},
{
"id": 3,
"title": "meh",
"count": 143,
"percent": 6.86
},
{
"id": 1,
"title": "skip",
"count": 68,
"percent": 3.26
}
],
"ratings_count": 2056,
"reviews_text_count": 25,
"added": 6296,
"added_by_status": {
"yet": 284,
"owned": 3522,
"beaten": 912,
"toplay": 951,
"dropped": 161,
"playing": 466
},
"metacritic": null,
"playtime": 22,
"suggestions_count": 630,
"user_game": null,
"reviews_count": 2086,
"saturated_color": "0f0f0f",
"dominant_color": "0f0f0f",
"platforms": [
{
"platform": {
"id": 4,
"name": "PC",
"slug": "pc",
"image": null,
"year_end": null,
"year_start": null,
"games_count": 203916,
"image_background": "https://media.rawg.io/media/games/8e0/8e032ac4faf1136e7d708bb3ac61af23.jpg"
},
"released_at": "2018-10-26",
"requirements_en": null,
"requirements_ru": null
},
{
"platform": {
"id": 1,
"name": "Xbox One",
"slug": "xbox-one",
"image": null,
"year_end": null,
"year_start": null,
"games_count": 3085,
"image_background": "https://media.rawg.io/media/games/c24/c24ec439abf4a2e92f3429dfa83f7f94.jpg"
},
"released_at": "2018-10-26",
"requirements_en": null,
"requirements_ru": null
},
{
"platform": {
"id": 18,
"name": "PlayStation 4",
"slug": "playstation4",
"image": null,
"year_end": null,
"year_start": null,
"games_count": 4504,
"image_background": "https://media.rawg.io/media/games/4be/4be6a6ad0364751a96229c56bf69be59.jpg"
},
"released_at": "2018-10-26",
"requirements_en": null,
"requirements_ru": null
}
],