Refactoring
This commit is contained in:
@@ -4,15 +4,15 @@
|
||||
hx-trigger="every 1m"
|
||||
hx-swap="outerHTML"
|
||||
hx-headers='{
|
||||
"If-Modified-Since": {{ (recent.last_updated, owned.last_updated) | max | int }},
|
||||
"If-None-Match": "{{ steam_etag() }}"
|
||||
"If-Modified-Since": {{ steam.last_updated | int }},
|
||||
"If-None-Match": "{{ steam.etag }}"
|
||||
}'
|
||||
>
|
||||
<h2><a href="https://steamcommunity.com/id/risdeveau">Steam</a></h2>
|
||||
|
||||
{% if recent.data.games %}
|
||||
{% if steam.caches.recent.data.games %}
|
||||
<h3>Recently played:</h3>
|
||||
{% for g in recent.data.games %}
|
||||
{% for g in steam.caches.recent.data.games %}
|
||||
<a href="https://store.steampowered.com/app/{{ g.appid }}" class="block">
|
||||
<picture>
|
||||
<source media="(max-width: 45rem)" srcset="{{ g.v_cover }}">
|
||||
@@ -31,12 +31,12 @@
|
||||
</div>
|
||||
</a>
|
||||
{% endfor %}
|
||||
<p>Last updated: {{ rtmsmp(recent.last_updated) }} ago</p>
|
||||
<p>Last updated: {{ rtmsmp(steam.caches.recent.last_updated) }} ago</p>
|
||||
{% endif %}
|
||||
|
||||
{% if owned.data.games %}
|
||||
{% if steam.caches.owned.data.games %}
|
||||
<h3>Top played games:</h3>
|
||||
{% set owned_games = owned.data.games | sort(attribute="playtime_forever", reverse=true) %}
|
||||
{% set owned_games = steam.caches.owned.data.games | sort(attribute="playtime_forever", reverse=true) %}
|
||||
{% for g in owned_games[:5] %}
|
||||
<a href="https://store.steampowered.com/app/{{ g.appid }}" class="block">
|
||||
<picture>
|
||||
@@ -58,6 +58,6 @@
|
||||
</div>
|
||||
</a>
|
||||
{% endfor %}
|
||||
<p>Last updated: {{ rtmsmp(owned.last_updated) }} ago</p>
|
||||
<p>Last updated: {{ rtmsmp(steam.caches.owned.last_updated) }} ago</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user