do not throw error when no stats to calculate

This commit is contained in:
Lukáš Kucharczyk 2024-10-16 11:38:07 +02:00
parent c517d735c7
commit 23502eab85
Signed by: lukas
SSH Key Fingerprint: SHA256:vMuSwvwAvcT6htVAioMP7rzzwMQNi3roESyhv+nAxeg
1 changed files with 40 additions and 30 deletions

View File

@ -62,36 +62,46 @@
<td class="px-2 sm:px-4 md:px-6 md:py-2">Finished ({{ year }})</td> <td class="px-2 sm:px-4 md:px-6 md:py-2">Finished ({{ year }})</td>
<td class="px-2 sm:px-4 md:px-6 md:py-2 font-mono">{{ this_year_finished_this_year_count }}</td> <td class="px-2 sm:px-4 md:px-6 md:py-2 font-mono">{{ this_year_finished_this_year_count }}</td>
</tr> </tr>
<tr> {% if longest_session_game.id %}
<td class="px-2 sm:px-4 md:px-6 md:py-2">Longest session</td> <tr>
<td class="px-2 sm:px-4 md:px-6 md:py-2 font-mono"> <td class="px-2 sm:px-4 md:px-6 md:py-2">Longest session</td>
{{ longest_session_time }} (<c-gamelink :game_id=longest_session_game.id :name=longest_session_game.name />) <td class="px-2 sm:px-4 md:px-6 md:py-2 font-mono">
</td> {{ longest_session_time }} (<c-gamelink :game_id=longest_session_game.id :name=longest_session_game.name />)
</tr> </td>
<tr> </tr>
<td class="px-2 sm:px-4 md:px-6 md:py-2">Most sessions</td> {% endif %}
<td class="px-2 sm:px-4 md:px-6 md:py-2 font-mono"> {% if highest_session_count_game.id %}
{{ highest_session_count }} (<c-gamelink :game_id=highest_session_count_game.id :name=highest_session_count_game.name />) <tr>
</td> <td class="px-2 sm:px-4 md:px-6 md:py-2">Most sessions</td>
</tr> <td class="px-2 sm:px-4 md:px-6 md:py-2 font-mono">
<tr> {{ highest_session_count }} (<c-gamelink :game_id=highest_session_count_game.id :name=highest_session_count_game.name />)
<td class="px-2 sm:px-4 md:px-6 md:py-2">Highest session average</td> </td>
<td class="px-2 sm:px-4 md:px-6 md:py-2 font-mono"> </tr>
{{ highest_session_average }} (<c-gamelink :game_id=highest_session_average_game.id :name=highest_session_average_game.name />) {% endif %}
</td> {% if highest_session_average_game.id %}
</tr> <tr>
<tr> <td class="px-2 sm:px-4 md:px-6 md:py-2">Highest session average</td>
<td class="px-2 sm:px-4 md:px-6 md:py-2">First play</td> <td class="px-2 sm:px-4 md:px-6 md:py-2 font-mono">
<td class="px-2 sm:px-4 md:px-6 md:py-2 font-mono"> {{ highest_session_average }} (<c-gamelink :game_id=highest_session_average_game.id :name=highest_session_average_game.name />)
<c-gamelink :game_id=first_play_game.id :name=first_play_game.name /> ({{ first_play_date }}) </td>
</td> </tr>
</tr> {% endif %}
<tr> {% if first_play_game.id %}
<td class="px-2 sm:px-4 md:px-6 md:py-2">Last play</td> <tr>
<td class="px-2 sm:px-4 md:px-6 md:py-2 font-mono"> <td class="px-2 sm:px-4 md:px-6 md:py-2">First play</td>
<c-gamelink :game_id=last_play_game.id :name=last_play_game.name /> ({{ last_play_date }}) <td class="px-2 sm:px-4 md:px-6 md:py-2 font-mono">
</td> <c-gamelink :game_id=first_play_game.id :name=first_play_game.name /> ({{ first_play_date }})
</tr> </td>
</tr>
{% endif %}
{% if last_play_game.id %}
<tr>
<td class="px-2 sm:px-4 md:px-6 md:py-2">Last play</td>
<td class="px-2 sm:px-4 md:px-6 md:py-2 font-mono">
<c-gamelink :game_id=last_play_game.id :name=last_play_game.name /> ({{ last_play_date }})
</td>
</tr>
{% endif %}
</tbody> </tbody>
</table> </table>
{% if month_playtime %} {% if month_playtime %}