Add backlog decrease count
This commit is contained in:
parent
fa2b9b5c88
commit
827279fb3d
|
@ -22,6 +22,7 @@
|
|||
* Finished (count)
|
||||
* Unfinished (count)
|
||||
* Refunded (count)
|
||||
* Backlog Decrease (count)
|
||||
|
||||
### Improved
|
||||
* game overview: simplify playtime range display
|
||||
|
|
|
@ -64,6 +64,10 @@
|
|||
<td class="px-2 sm:px-4 md:px-6 md:py-2">Unfinished</td>
|
||||
<td class="px-2 sm:px-4 md:px-6 md:py-2 font-mono">{{ purchased_unfinished.count }} ({{ unfinished_purchases_percent }}%)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="px-2 sm:px-4 md:px-6 md:py-2">Backlog Decrease</td>
|
||||
<td class="px-2 sm:px-4 md:px-6 md:py-2 font-mono">{{ backlog_decrease_count }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="px-2 sm:px-4 md:px-6 md:py-2">Spendings ({{ total_spent_currency }})</td>
|
||||
<td class="px-2 sm:px-4 md:px-6 md:py-2 font-mono">{{ total_spent }} ({{ spent_per_game }}/game)</td>
|
||||
|
|
|
@ -356,6 +356,12 @@ def stats(request, year: int = 0):
|
|||
for item in total_playtime_per_platform:
|
||||
item["formatted_playtime"] = format_duration(item["total_playtime"], "%2.0H")
|
||||
|
||||
backlog_decrease_count = (
|
||||
Purchase.objects.filter(date_purchased__year__lt=year)
|
||||
.filter(date_finished__year=year)
|
||||
.count()
|
||||
)
|
||||
|
||||
context = {
|
||||
"total_hours": format_duration(
|
||||
year_sessions.total_duration_unformatted(), "%2.0H"
|
||||
|
@ -390,6 +396,7 @@ def stats(request, year: int = 0):
|
|||
),
|
||||
"all_purchased_refunded_this_year": all_purchased_refunded_this_year,
|
||||
"all_purchased_this_year": all_purchased_this_year,
|
||||
"backlog_decrease_count": backlog_decrease_count,
|
||||
}
|
||||
|
||||
request.session["return_path"] = request.path
|
||||
|
|
Loading…
Reference in New Issue