add: pull track duration

This commit is contained in:
trisua 2025-04-26 21:12:29 -04:00
parent f10384ff39
commit 498884291e
4 changed files with 53 additions and 11 deletions

View file

@ -860,13 +860,15 @@ if state and state.data %}
</div>
<div class="card secondary flex gap-2">
<img
src="{{ state.external_urls.track_img }}"
alt="Track cover"
loading="lazy"
class="avatar"
style="--size: {{ size }}"
/>
<a href="{{ state.external_urls.track }}">
<img
src="{{ state.external_urls.track_img }}"
alt="Track cover"
loading="lazy"
class="avatar"
style="--size: {{ size }}"
/>
</a>
<div class="flex flex-col">
<h5 class="w-full">
@ -880,6 +882,16 @@ if state and state.data %}
>{{ state.data.artist }}</a
></span
>
{% if state.data.duration_ms and state.data.duration_ms != "0" %}
<span
hook="spotify_time_text"
hook-arg:updated="{{ state.data.timestamp }}"
hook-arg:progress="25000"
hook-arg:duration="{{ state.data.duration_ms }}"
hook-arg:display="full"
></span>
{% endif %}
</div>
</div>
</div>

View file

@ -9,7 +9,7 @@ macros -%}
<meta
http-equiv="content-security-policy"
content="default-src 'self' blob: *.spotify.com; img-src * data:; media-src *; font-src *; style-src 'unsafe-inline' 'self' blob: *; script-src 'self' 'unsafe-inline' blob: *; object-src 'self' blob: *; upgrade-insecure-requests; connect-src * localhost; frame-src 'self' blob: data: *"
content="default-src 'self' blob: *.spotify.com musicbrainz.org; img-src * data:; media-src *; font-src *; style-src 'unsafe-inline' 'self' blob: *; script-src 'self' 'unsafe-inline' blob: *; object-src 'self' blob: *; upgrade-insecure-requests; connect-src * localhost; frame-src 'self' blob: data: *"
/>
<link rel="icon" href="/public/favicon.svg" />