[scrobbles] Fix datalog return value and message

This commit is contained in:
2024-08-19 12:27:47 -04:00
parent ca36e25948
commit cfd6ac861e

View File

@ -603,13 +603,13 @@ class Scrobble(TimeStampedModel):
) )
@property @property
def logdata(self) -> dict: def logdata(self) -> Optional[logdata.JSONDataclass]:
if not self.media_obj.logdata_cls: if not self.media_obj.logdata_cls:
logger.warn( logger.warn(
f"Media type has no log data class", f"Media type has no log data class, you should add one!",
extra={"media_type": self.media_type, "scrobble_id": self.id}, extra={"media_type": self.media_type, "scrobble_id": self.id},
) )
return {} return None
return self.media_obj.logdata_cls.from_dict(json.loads(self.log)) return self.media_obj.logdata_cls.from_dict(json.loads(self.log))