From 75ec6a49e9ee7b8b736a4786d47763b6dae2512d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro?= Date: Fri, 14 Jun 2024 03:01:06 +0200 Subject: [PATCH] directly save ranked to ranked bucket --- .../components/champion_components/summoner_spells.ex | 4 +++- .../lib/scrapper/processor/match_processor.ex | 11 ++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/apps/lol_analytics_web/lib/lol_analytics_web/components/champion_components/summoner_spells.ex b/apps/lol_analytics_web/lib/lol_analytics_web/components/champion_components/summoner_spells.ex index d453326..938e176 100644 --- a/apps/lol_analytics_web/lib/lol_analytics_web/components/champion_components/summoner_spells.ex +++ b/apps/lol_analytics_web/lib/lol_analytics_web/components/champion_components/summoner_spells.ex @@ -12,7 +12,9 @@ defmodule LolAnalyticsWeb.ChampionComponents.SummonerSpells do

<%= spell.win_rate %>%

<%= spell.wins %>/<%= spell.total_games %>

-
<%= spell.name %>
+
+

<%= spell.name %>

+
<% end %> diff --git a/apps/scrapper/lib/scrapper/processor/match_processor.ex b/apps/scrapper/lib/scrapper/processor/match_processor.ex index a6d3ed4..46892ce 100644 --- a/apps/scrapper/lib/scrapper/processor/match_processor.ex +++ b/apps/scrapper/lib/scrapper/processor/match_processor.ex @@ -44,7 +44,16 @@ defmodule Scrapper.Processor.MatchProcessor do def process_resp({:ok, raw_match}, match_id) do decoded_match = Poison.decode!(raw_match, as: %LoLAPI.Model.MatchResponse{}) - match_url = Storage.MatchStorage.S3MatchStorage.store_match(match_id, raw_match, "matches") + + match_url = + case decoded_match.info.queueId do + 420 -> + Storage.MatchStorage.S3MatchStorage.store_match(match_id, raw_match, "ranked") + + queue_id -> + Storage.MatchStorage.S3MatchStorage.store_match(match_id, raw_match, queue_id) + end + match = LolAnalytics.Match.MatchRepo.get_match(match_id) case match do