Skip to content

Commit 9c4dd6a

Browse files
authored
Fixed circref, advSearch bug (#169)
1 parent 41d2aa2 commit 9c4dd6a

File tree

3 files changed

+13
-16
lines changed

3 files changed

+13
-16
lines changed

gui/advSearch.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from gui.gui import ActiveWindow, close_all_windows
44
from item.generator import Currency, Item, ModInfo
55
from utils.common import get_response, price_item
6+
from utils import config
67
from utils.config import (
78
GUI_BG1,
89
GUI_BG2,

utils/common.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ def get_response(item):
4040

4141
return response
4242

43-
4443
def get_trade_data(item):
4544
"""For the given item, find current listings and retrieve prices & times
4645

utils/web.py

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import requests
1010
from tqdm import tqdm
1111

12-
import item.generator as ig
1312
from item.itemModifier import ItemModifier, ItemModifierType
1413
from utils import config
1514
from utils.config import RELEASE_URL, VERSION
@@ -387,22 +386,20 @@ def open_exchange_site(rid, league):
387386

388387
def get_poe_prices_info(item):
389388
try:
390-
if isinstance(item, ig.Item):
391-
league = bytes(config.LEAGUE, "utf-8")
392-
try:
393-
results = requests.post(
394-
b"http://poeprices.info/api?l="
395-
+ league
396-
+ b"&i="
397-
+ base64.b64encode(bytes(item.text, "utf-8"))
398-
)
399-
return results.json()
400-
except Exception:
401-
logging.info("poeprices.info is not available.")
402-
return {}
403-
else:
389+
league = bytes(config.LEAGUE, "utf-8")
390+
try:
391+
results = requests.post(
392+
b"http://poeprices.info/api?l="
393+
+ league
394+
+ b"&i="
395+
+ base64.b64encode(bytes(item.text, "utf-8"))
396+
)
397+
return results.json()
398+
except Exception:
399+
logging.info("poeprices.info is not available.")
404400
return {}
405401
except Exception:
406402
logging.error("Could not retrieve data from poeprices.info")
407403
logging.error(item.text)
408404
logging.error(traceback.print_exc())
405+
return {}

0 commit comments

Comments
 (0)