More game overview optimizations
This commit is contained in:
parent
854e3cc54a
commit
a765fd8d00
|
@ -57,7 +57,7 @@
|
|||
</ul>
|
||||
<h1 class="text-3xl mt-4 mb-1 flex gap-2 items-center">
|
||||
Sessions
|
||||
<span class="dark:text-slate-500">({{ sessions.count }})</span>
|
||||
<span class="dark:text-slate-500">({{ session_count }})</span>
|
||||
{% url 'start_game_session' game.id as add_session_link %}
|
||||
{% include 'components/button.html' with title="Start new session" text="New" link=add_session_link %}
|
||||
and Notes <span class="dark:text-slate-500">({{ sessions_with_notes_count }})</span>
|
||||
|
|
|
@ -170,7 +170,9 @@ def view_game(request, game_id=None):
|
|||
.order_by("year_released")
|
||||
)
|
||||
|
||||
sessions = Session.objects.filter(purchase__edition__game=game)
|
||||
sessions = Session.objects.prefetch_related("device").filter(
|
||||
purchase__edition__game=game
|
||||
)
|
||||
session_count = sessions.count()
|
||||
|
||||
playrange_start = sessions.earliest().timestamp_start.strftime("%b %Y")
|
||||
|
|
Loading…
Reference in New Issue