[scrobbles] Start cleaning up logdata

This commit is contained in:
2025-08-05 02:01:31 -04:00
parent 06e075553a
commit 278cab32ea
9 changed files with 191 additions and 54 deletions

View File

@ -65,6 +65,10 @@ class ScrobblableMixin(TimeStampedModel):
class Meta:
abstract = True
@classmethod
def is_long_play_media(cls) -> bool:
return False
def scrobble_for_user(
self,
user_id,
@ -136,6 +140,15 @@ class LongPlayScrobblableMixin(ScrobblableMixin):
class Meta:
abstract = True
@classmethod
def is_long_play_media(cls) -> bool:
return True
def is_complete(self) -> bool:
if self.log:
return bool(self.log.get("long_play_complete", None))
return False
def get_longplay_finish_url(self):
return reverse("scrobbles:longplay-finish", kwargs={"uuid": self.uuid})