소스 검색

[beers] Fix missing abv error

Colin Powell 8 달 전
부모
커밋
1f0c950b17
4개의 변경된 파일27개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      vrobbler/apps/beers/untappd.py
  2. 25 0
      vrobbler/apps/scrobbles/events.py
  3. 0 0
      vrobbler/apps/scrobbles/messagebus.py
  4. 0 0
      vrobbler/apps/scrobbles/services.py

+ 2 - 0
vrobbler/apps/beers/untappd.py

@@ -66,6 +66,8 @@ def get_abv_from_soup(soup) -> Optional[float]:
         pass
     except ValueError:
         pass
+    if "N/A" in abv:
+        abv = None
     return abv
 
 

+ 25 - 0
vrobbler/apps/scrobbles/events.py

@@ -0,0 +1,25 @@
+from dataclasses import dataclass
+
+
+class Event:
+    pass
+
+
+@dataclass
+class Start(Event):
+    scrobble_id: str
+
+
+@dataclass
+class Pause(Event):
+    scrobble_id: str
+
+
+@dataclass
+class Cancel(Event):
+    scrobble_id: str
+
+
+@dataclass
+class Stop(Event):
+    scrobble_id: str

+ 0 - 0
vrobbler/apps/scrobbles/messagebus.py


+ 0 - 0
vrobbler/apps/scrobbles/services.py