[scrobbles] Start cleaning up logdata
This commit is contained in:
@ -738,7 +738,7 @@ class Scrobble(TimeStampedModel):
|
||||
log_dict = {}
|
||||
|
||||
try:
|
||||
return logdata_cls.from_dict(log_dict)
|
||||
return logdata_cls(**log_dict)
|
||||
except ParseError as e:
|
||||
logger.warning(
|
||||
"Could not parse log data",
|
||||
@ -749,6 +749,8 @@ class Scrobble(TimeStampedModel):
|
||||
},
|
||||
)
|
||||
return logdata_cls()
|
||||
except TypeError as e:
|
||||
return logdata_cls()
|
||||
|
||||
def redirect_url(self, user_id) -> str:
|
||||
user = User.objects.filter(id=user_id).first()
|
||||
@ -1065,8 +1067,7 @@ class Scrobble(TimeStampedModel):
|
||||
return media_obj
|
||||
|
||||
def __str__(self):
|
||||
timestamp = self.timestamp.strftime("%Y-%m-%d")
|
||||
return f"Scrobble of {self.media_obj} ({timestamp})"
|
||||
return f"Scrobble of {self.media_obj} ({self.timestamp})"
|
||||
|
||||
def calc_reading_duration(self) -> int:
|
||||
duration = 0
|
||||
|
||||
Reference in New Issue
Block a user