Skip to content

Commit

Permalink
Merge pull request #39 from Its-Haze/fix/chroma-skins-not-detected
Browse files Browse the repository at this point in the history
Chroma skins correctly detected
  • Loading branch information
Its-Haze authored May 18, 2024
2 parents fe47354 + b22cc53 commit 4c24d12
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
2 changes: 1 addition & 1 deletion league_rpc/__version__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Set version number of package."""

__version__ = "v2.1.1"
__version__ = "v2.1.2"
import requests

RELEASES_PAGE = "https://github.com/Its-Haze/league-rpc/releases"
Expand Down
15 changes: 2 additions & 13 deletions league_rpc/champion.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,6 @@ def gather_league_data(
skin_id: int = 0
skin_name: Optional[str] = None

skin_ids: list[int] = []

for player in parsed_data["allPlayers"]:
if player["riotId"] == summoners_name:
raw_champion_name: str = player["rawChampionName"].split("_")[-1]
Expand All @@ -116,18 +114,9 @@ def gather_league_data(

skin_id = player["skinID"]

skin_ids = [
i["num"] for i in champion_data["data"][raw_champion_name]["skins"]
]

if skin_id:
while skin_id not in skin_ids:
skin_id -= 1

for i in champion_data["data"][raw_champion_name]["skins"]:
if skin_id == i["num"]:
skin_name = i["name"]
break
# skinName is not always present in the data.
skin_name = player["skinName"]
break
continue
return champion_name, skin_id, skin_name
Expand Down

0 comments on commit 4c24d12

Please sign in to comment.