fix: spotify connection

This commit is contained in:
trisua 2025-06-22 14:11:15 -04:00
parent 2f83497f98
commit efd4ac8104
2 changed files with 5 additions and 1 deletions

View file

@ -12,6 +12,7 @@
(text "{% if connection_type == \"Spotify\" and user and user.connections.Spotify and config.connections.spotify_client_id %}")
(script
("defer" "true")
(text "setTimeout(async () => {
const code = new URLSearchParams(window.location.search).get(\"code\");
const client_id = \"{{ config.connections.spotify_client_id }}\";
@ -46,10 +47,11 @@
setTimeout(() => {
window.location.href = \"/settings#/connections\";
}, 500);
}, 150);"))
}, 1000);"))
(text "{% elif connection_type == \"LastFm\" and user and user.connections.LastFm and config.connections.last_fm_key %}")
(script
("defer" "true")
(text "setTimeout(async () => {
const token = new URLSearchParams(window.location.search).get(\"token\");
const api_key = \"{{ config.connections.last_fm_key }}\";

View file

@ -132,9 +132,11 @@
(text "{{ profile.settings.biography|markdown|safe }}"))
(div
("class" "card flex flex-col gap-2")
(text "{% if user -%}")
(div
("style" "display: contents;")
(text "{% if profile.connections.Spotify and profile.connections.Spotify[0].data.name -%} {{ components::spotify_playing(state=profile.connections.Spotify[1]) }} {% elif profile.connections.LastFm and profile.connections.LastFm[0].data.name %} {{ components::last_fm_playing(state=profile.connections.LastFm[1]) }} {%- endif %}"))
(text "{%- endif %}")
(div
("class" "w-full flex justify-between items-center")
(span