Skip to content

Commit

Permalink
Fix Artifact setName None error
Browse files Browse the repository at this point in the history
  • Loading branch information
pwnless committed Dec 18, 2023
1 parent f9bebad commit 8334b43
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions enkapy/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,7 @@ async def fetch_user(self, uid: int, player_only=False) -> EnkaData:
for equip in character.equipList:
equip.flat.nameText = await self.resolve_text_hash(equip.flat.nameTextMapHash, self.lang)
if isinstance(equip, Artifact):
equip.flat.nameTextMapHash = await self.resolve_text_hash(equip.flat.setNameTextMapHash,
self.lang)
equip.flat.setNameText = await self.resolve_text_hash(equip.flat.setNameTextMapHash, self.lang)
if character.id in self._avatar_data:
character.name = await self.resolve_text_hash(
self._avatar_data[character.id]['nameTextMapHash'],
Expand Down
2 changes: 1 addition & 1 deletion enkapy/model/artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class ArtifactFlat(BaseModel):
"""Artifact sub stats"""
setNameTextMapHash: str
"""Artifact name hash"""
nameTextMapHash: Optional[str] = Field('')
setNameText: Optional[str] = Field('')
"""Artifact set name text
*Note: You must called load_lang before otherwise this field is empty*"""
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setuptools.setup(
name="enka.py",
version="1.1.7",
version="1.1.8",
author="pwnless",
author_email="[email protected]",
description="Library for fetching JSON data from site https://enka.network/",
Expand Down

1 comment on commit 8334b43

@pwnless
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nitolar Note: setNameText and nameText are completely different things, also please don't rename variables randomly, equipType wasn't meant to be same as itemType

Please sign in to comment.