File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,9 +76,10 @@ class PlayerMatchStatSerializer < Blueprinter::Base
7676 # I'll add a `spell_icon_url_by_name` to the service or just handle it here.
7777 # Let's keep it simple:
7878
79+ cdn = RiotCdnService . new
7980 {
8081 name : spell_name ,
81- icon_url : "#{ RiotCdnService ::BASE_URL } /#{ RiotCdnService :: DEFAULT_VERSION } /img/spell/#{ spell_name } .png"
82+ icon_url : "#{ RiotCdnService ::BASE_URL } /#{ cdn . cached_latest_version } /img/spell/#{ spell_name } .png"
8283 }
8384 end
8485 end
Original file line number Diff line number Diff line change @@ -31,7 +31,10 @@ class ScoutingTargetSerializer < Blueprinter::Base
3131 field :avatar_url do |target |
3232 target . avatar_url || target . metadata &.dig ( 'avatar_url' ) || begin
3333 icon_id = target . profile_icon_id || target . metadata &.dig ( 'profile_icon_id' )
34- icon_id ? "https://ddragon.leagueoflegends.com/cdn/14.1.1/img/profileicon/#{ icon_id } .png" : nil
34+ if icon_id
35+ cdn = RiotCdnService . new
36+ "https://ddragon.leagueoflegends.com/cdn/#{ cdn . cached_latest_version } /img/profileicon/#{ icon_id } .png"
37+ end
3538 end
3639 end
3740
You can’t perform that action at this time.
0 commit comments