Skip to content

Commit

Permalink
fix incorrect type from diablo.trade
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisoro committed Jul 9, 2024
1 parent 73d41d0 commit 01e1b8b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

TP = concurrent.futures.ThreadPoolExecutor()

__version__ = "5.6.4"
__version__ = "5.6.5"
10 changes: 9 additions & 1 deletion src/gui/importer/diablo_trade.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,15 @@ def _construct_api_url(listing_url: str, cursor: int = 1) -> str:


def _create_affixes_from_api_dict(affixes: list[dict[str, Any]]) -> list[Affix]:
res = [Affix(name=closest_match(clean_str(affix["name"]), Dataloader().affix_dict), value=affix["value"]) for affix in affixes]
res = []
for affix in affixes:
new_affix = Affix(name=closest_match(clean_str(affix["name"]), Dataloader().affix_dict), value=affix["value"])
if isinstance(new_affix.value, list):
if new_affix.value:
new_affix.value = new_affix.value[0]
else:
new_affix.value = 0
res.append(new_affix)
if len(affixes) != len(res) or any(x.name is None for x in res):
LOGGER.error(f"If you see this create a bug ticket! {affixes=}")
return res
Expand Down

0 comments on commit 01e1b8b

Please sign in to comment.