From 1f0c950b17402f7a5f9518bf924e42fe582c0d30 Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Fri, 1 Nov 2024 22:39:46 -0400 Subject: [PATCH] [beers] Fix missing abv error --- vrobbler/apps/beers/untappd.py | 2 ++ vrobbler/apps/scrobbles/events.py | 25 +++++++++++++++++++++++++ vrobbler/apps/scrobbles/messagebus.py | 0 vrobbler/apps/scrobbles/services.py | 0 4 files changed, 27 insertions(+) create mode 100644 vrobbler/apps/scrobbles/events.py create mode 100644 vrobbler/apps/scrobbles/messagebus.py create mode 100644 vrobbler/apps/scrobbles/services.py diff --git a/vrobbler/apps/beers/untappd.py b/vrobbler/apps/beers/untappd.py index adaee75..b46d8c5 100644 --- a/vrobbler/apps/beers/untappd.py +++ b/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 diff --git a/vrobbler/apps/scrobbles/events.py b/vrobbler/apps/scrobbles/events.py new file mode 100644 index 0000000..6cbd20f --- /dev/null +++ b/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 diff --git a/vrobbler/apps/scrobbles/messagebus.py b/vrobbler/apps/scrobbles/messagebus.py new file mode 100644 index 0000000..e69de29 diff --git a/vrobbler/apps/scrobbles/services.py b/vrobbler/apps/scrobbles/services.py new file mode 100644 index 0000000..e69de29