diff --git a/vrobbler/apps/puzzles/models.py b/vrobbler/apps/puzzles/models.py index b10fcff..be0a54d 100644 --- a/vrobbler/apps/puzzles/models.py +++ b/vrobbler/apps/puzzles/models.py @@ -11,17 +11,15 @@ from django_extensions.db.models import TimeStampedModel from imagekit.models import ImageSpecField from imagekit.processors import ResizeToFit from puzzles.sources import ipdb -from scrobbles.dataclasses import JSONDataclass +from scrobbles.dataclasses import BaseLogData, WithPeopleLogData, LongPlayLogData from scrobbles.mixins import ScrobblableConstants, ScrobblableMixin BNULL = {"blank": True, "null": True} @dataclass -class PuzzleLogData(JSONDataclass): - with_people: Optional[int] = None +class PuzzleLogData(BaseLogData, WithPeopleLogData, LongPlayLogData): rating: Optional[str] = None - notes: Optional[str] = None class PuzzleManufacturer(TimeStampedModel): diff --git a/vrobbler/apps/scrobbles/views.py b/vrobbler/apps/scrobbles/views.py index db0adb7..87cf16d 100644 --- a/vrobbler/apps/scrobbles/views.py +++ b/vrobbler/apps/scrobbles/views.py @@ -949,7 +949,7 @@ class ScrobbleDetailView(DetailView): log = self.object.log or {} initial_notes = log.get("notes", []) - if isinstance(initial_notes, list) and isinstance(initial_notes[0], dict): + if isinstance(initial_notes, list) and len(initial_notes) > 0 and isinstance(initial_notes[0], dict): notes_str = note_list_to_str(notes) else: notes_str = "\n".join(initial_notes) diff --git a/vrobbler/templates/_longplay_scrobblable_list.html b/vrobbler/templates/_longplay_scrobblable_list.html new file mode 100644 index 0000000..0f3a01e --- /dev/null +++ b/vrobbler/templates/_longplay_scrobblable_list.html @@ -0,0 +1,43 @@ +{% load urlreplace %} +{% load naturalduration %} + +
| Latest | +Title | +Scrobbles | +Complete | +Start | +
|---|---|---|---|---|
| {{obj.scrobble_set.last.local_timestamp}} + | {{obj}} | + {% if request.user.is_authenticated %} +{{obj.scrobble_count}} | +{% if obj.scrobble_set.last.logdata.long_play_complete == True %}Yes{% endif %} | +Scrobble | + {% endif %} +
+ + {% if page_obj.has_previous %} + prev + {% endif %} + + Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }} + + {% if page_obj.has_next %} + next + {% endif %} + +
diff --git a/vrobbler/templates/books/book_list.html b/vrobbler/templates/books/book_list.html index 1d3accb..b62d977 100644 --- a/vrobbler/templates/books/book_list.html +++ b/vrobbler/templates/books/book_list.html @@ -16,7 +16,7 @@