From 80381fbad80fe56f5b19226d530fec89c5c6445d Mon Sep 17 00:00:00 2001 From: Luke Robles Date: Thu, 1 Jun 2023 21:19:20 -0700 Subject: [PATCH] move buy location lower in the embed, if not buyable, dont add it to the embed --- app/star_citizen.py | 18 +++++++++--------- app/stock.py | 0 argocd-application.yaml | 0 3 files changed, 9 insertions(+), 9 deletions(-) mode change 100755 => 100644 app/stock.py mode change 100755 => 100644 argocd-application.yaml diff --git a/app/star_citizen.py b/app/star_citizen.py index 25c394d8..66ce84fa 100644 --- a/app/star_citizen.py +++ b/app/star_citizen.py @@ -77,15 +77,6 @@ async def get_ship(ship_name): value=price, inline=True, ) - - buy_location = soup.find_all("td", {"class": "Location smwtype_wpg"}) - - embed.add_field( - name="**Where to buy**", - value=", ".join(str(x.text) for x in buy_location), - inline=True, - ) - try: pledge_price = ( soup.find("div", {"class": "infobox__label"}, string="Standalone") @@ -113,6 +104,15 @@ async def get_ship(ship_name): inline=True, ) + buy_location = soup.find_all("td", {"class": "Location smwtype_wpg"}) + + if len(buy_location): + embed.add_field( + name="**Buyable At**", + value=", ".join(str(x.text) for x in buy_location), + inline=True, + ) + # embed.add_field(name="-------", value="", inline=False) # embed.add_field(name="**Description**", value=ship["description"], inline=False) embed.add_field(name="-------", value="", inline=False) diff --git a/app/stock.py b/app/stock.py old mode 100755 new mode 100644 diff --git a/argocd-application.yaml b/argocd-application.yaml old mode 100755 new mode 100644