[scrobbling] Refactor webhook and simplify

This commit is contained in:
2024-08-12 00:03:30 -05:00
parent cc9a2a64df
commit 5e22cb3106
11 changed files with 249 additions and 301 deletions

View File

@ -29,12 +29,6 @@ class LifeEvent(ScrobblableMixin):
def find_or_create(cls, title: str) -> "LifeEvent":
return cls.objects.filter(title=title).first()
def scrobble_for_user(self, user_id):
Scrobble = apps.get_model("scrobbles", "Scrobble")
return Scrobble.objects.create(
user_id=user_id, life_event=self, timestamp=pendulum.now()
)
def scrobbles(self, user_id):
Scrobble = apps.get_model("scrobbles", "Scrobble")
return Scrobble.objects.filter(