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 %} + + + + + + + + + + + + + {% for obj in object_list %} + {% if obj.title %} + + + {% if request.user.is_authenticated %} + + + + {% endif %} + + {% endif %} + {% endfor %} + +
LatestTitleScrobblesCompleteStart
{{obj.scrobble_set.last.local_timestamp}} + {{obj}}{{obj.scrobble_count}}{% if obj.scrobble_set.last.logdata.long_play_complete == True %}Yes{% endif %}Scrobble
+ +

+ + {% 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 @@
- {% include "_scrobblable_list.html" %} + {% include "_longplay_scrobblable_list.html" %}
diff --git a/vrobbler/templates/bricksets/brickset_list.html b/vrobbler/templates/bricksets/brickset_list.html index b6f76ea..5f4376c 100644 --- a/vrobbler/templates/bricksets/brickset_list.html +++ b/vrobbler/templates/bricksets/brickset_list.html @@ -16,7 +16,7 @@
- {% include "_scrobblable_list.html" %} + {% include "_longplay_scrobblable_list.html" %}
diff --git a/vrobbler/templates/puzzles/puzzle_list.html b/vrobbler/templates/puzzles/puzzle_list.html index 01e31d0..2782835 100644 --- a/vrobbler/templates/puzzles/puzzle_list.html +++ b/vrobbler/templates/puzzles/puzzle_list.html @@ -16,7 +16,7 @@
- {% include "_scrobblable_list.html" %} + {% include "_longplay_scrobblable_list.html" %}