Skip to content

Commit 852c74c

Browse files
authored
(Bugfix) Fixed issue where some maxroll aspects were not properly imported. Additionally, if an aspect can't be found, it just won't be imported instead of adding it and making the profile fail. (#515)
1 parent c597f13 commit 852c74c

File tree

4 files changed

+15
-11
lines changed

4 files changed

+15
-11
lines changed

src/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
TP = concurrent.futures.ThreadPoolExecutor()
44

5-
__version__ = "7.2.1"
5+
__version__ = "7.2.2"

src/gui/importer/d4builds.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,9 @@ def _get_legendary_aspects(data: lxml.html.HtmlElement) -> list[str]:
213213
aspect_name = correct_name(aspect.text.lower().replace("aspect", "").strip())
214214

215215
if aspect_name not in Dataloader().aspect_list:
216-
LOGGER.warning(f"Imported legendary aspect '{aspect_name}' that is not in our aspect data, please report a bug.")
217-
218-
result.append(aspect_name)
216+
LOGGER.warning(f"Legendary aspect '{aspect_name}' that is not in our aspect data, unable to add to AspectUpgrades.")
217+
else:
218+
result.append(aspect_name)
219219

220220
return result
221221

src/gui/importer/maxroll.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from src.item.data.affix import Affix
1313
from src.item.data.item_type import ItemType
1414
from src.item.descr.text import clean_str, closest_match
15+
from src.scripts.common import correct_name
1516

1617
LOGGER = logging.getLogger(__name__)
1718

@@ -93,9 +94,11 @@ def import_maxroll(config: ImportConfig):
9394
legendary_aspect = _find_legendary_aspect(mapping_data, resolved_item["legendaryPower"])
9495
if legendary_aspect:
9596
if legendary_aspect not in Dataloader().aspect_list:
96-
LOGGER.warning(f"Imported legendary aspect '{legendary_aspect}' that is not in our aspect data, please report a bug.")
97-
98-
aspect_upgrade_filters.append(legendary_aspect)
97+
LOGGER.warning(
98+
f"Legendary aspect '{legendary_aspect}' that is not in our aspect data, unable to add to AspectUpgrades."
99+
)
100+
else:
101+
aspect_upgrade_filters.append(legendary_aspect)
99102
else:
100103
LOGGER.warning(
101104
f"Unable to find legendary aspect in maxroll data for {item_type}, can not automatically add to AspectUpgrades"
@@ -223,9 +226,9 @@ def _find_legendary_aspect(mapping_data: dict, legendary_aspect: dict) -> str |
223226
continue
224227

225228
if "prefix" in affix:
226-
return affix["prefix"].lower().replace(" ", "_")
229+
return correct_name(affix["prefix"])
227230
if "suffix" in affix:
228-
return affix["suffix"].lower().replace(" ", "_")
231+
return correct_name(affix["suffix"])
229232
return None
230233

231234
return None

src/gui/importer/mobalytics.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,9 @@ def _get_legendary_aspect(name: str) -> str:
200200
aspect_name = correct_name(name.lower().replace("aspect", "").strip())
201201

202202
if aspect_name not in Dataloader().aspect_list:
203-
LOGGER.warning(f"Imported legendary aspect '{aspect_name}' that is not in our aspect data, please report a bug.")
204-
return aspect_name
203+
LOGGER.warning(f"Legendary aspect '{aspect_name}' that is not in our aspect data, unable to add to AspectUpgrades.")
204+
else:
205+
return aspect_name
205206
return ""
206207

207208

0 commit comments

Comments
 (0)