[scrobbles] Add basic sentiment analysis
All checks were successful
build / test (push) Successful in 2m4s

This commit is contained in:
2026-06-05 19:31:06 -04:00
parent 371e1d654c
commit dec7a79509
9 changed files with 188 additions and 8 deletions

View File

@ -882,8 +882,14 @@ class Scrobble(TimeStampedModel):
logger.warning("Log data could not be loaded", e)
return logdata_cls()
# Strip log-only keys (stored in JSONField but not part of LogData dataclass)
logdata_kwargs = {
k: v for k, v in log_dict.items()
if k in logdata_cls.__dataclass_fields__
}
try:
return logdata_cls(**log_dict)
return logdata_cls(**logdata_kwargs)
except ParseError as e:
logger.warning(
"Could not parse log data",