diff --git a/vrobbler/apps/scrobbles/dataclasses.py b/vrobbler/apps/scrobbles/dataclasses.py index c8a86cc..adfc6e9 100644 --- a/vrobbler/apps/scrobbles/dataclasses.py +++ b/vrobbler/apps/scrobbles/dataclasses.py @@ -49,6 +49,23 @@ class BaseLogData(JSONDataclass): def override_fields(cls) -> dict: return {} + def notes_as_str(self) -> str: + note_str = "" + + if not self.notes: + return note_str + + if self.notes: + if isinstance(self.notes, str): + note_str = self.notes.encode("utf-8").decode("unicode_escape") + if isinstance(self.notes, list): + note_str = ( + "\n".join(self.notes) + .encode("utf-8") + .decode("unicode_escape") + ) + return note_str + @dataclass class LongPlayLogData(JSONDataclass): diff --git a/vrobbler/apps/scrobbles/views.py b/vrobbler/apps/scrobbles/views.py index a6a7a40..97f7d12 100644 --- a/vrobbler/apps/scrobbles/views.py +++ b/vrobbler/apps/scrobbles/views.py @@ -23,6 +23,8 @@ from django.views.generic.list import ListView from moods.models import Mood from music.aggregators import ( artist_scrobble_count, + week_of_scrobbles, + scrobble_counts, live_charts, live_tv_charts, live_youtube_channel_charts,