Ver código fonte

[beers] Fix rating error

Colin Powell 8 meses atrás
pai
commit
76272b7e39
1 arquivos alterados com 3 adições e 3 exclusões
  1. 3 3
      vrobbler/apps/beers/untappd.py

+ 3 - 3
vrobbler/apps/beers/untappd.py

@@ -87,11 +87,11 @@ def get_ibu_from_soup(soup) -> Optional[int]:
 def get_rating_from_soup(soup) -> str:
     rating = ""
     try:
-        rating = soup.find(class_="num").get_text().strip("(").strip(")")
+        rating = float(soup.find(class_="num").get_text().strip("(").strip(")"))
     except AttributeError:
-        pass
+        rating = None
     except ValueError:
-        pass
+        rating = None
     return rating