Skip to content

Commit

Permalink
Added emerald rank, switched to latest icons
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominik süßenbach committed Jul 28, 2024
1 parent a1d35a9 commit 0a91254
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/Services/Gateways/LeagueOfLegendsGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,16 +321,16 @@ public function grabRankImage(string $rankName): ?string
{
$rankImage = null;
if (! $this->getRankImageFolderPath()) {
if ($archiveFilePath = $this->downloadArchive('https://static.developer.riotgames.com/docs/lol/ranked-emblems.zip', 'rank-icons')) {
$rankImageFolderPath = getcwd().'/storage/rank-icons';
if ($archiveFilePath = $this->downloadArchive('https://static.developer.riotgames.com/docs/lol/ranked-emblems-latest.zip', 'rank-icons')) {
$rankImageFolderPath = getcwd().'/storage/ranked-emblems-latest';
if ($this->extractArchive($archiveFilePath, $rankImageFolderPath)) {
$this->setRankImageFolderPath($rankImageFolderPath);
File::delete($archiveFilePath);
}
}
}

$fileName = 'Emblem_'.substr($rankName, 0, strpos($rankName, ' ') ?: strlen($rankName)).'.png';
$fileName = 'Rank='.substr($rankName, 0, strpos($rankName, ' ') ?: strlen($rankName)).'.png';

if (File::exists($this->getRankImageFolderPath().'/'.$fileName)) {
$rankImage = File::get($this->getRankImageFolderPath().'/'.$fileName, true);
Expand Down

0 comments on commit 0a91254

Please sign in to comment.