Fix URL encoding showing up in title

This commit is contained in:
Sijmen 2023-05-13 14:51:22 +02:00
parent cac047d121
commit 3b018da07e
Signed by: vijfhoek
GPG key ID: DAF7821E067D9C48
3 changed files with 5 additions and 3 deletions

2
Cargo.lock generated
View file

@ -94,6 +94,8 @@ dependencies = [
"humansize", "humansize",
"num-traits", "num-traits",
"percent-encoding", "percent-encoding",
"serde",
"serde_json",
] ]
[[package]] [[package]]

View file

@ -8,7 +8,7 @@ repository = "https://github.com/vijfhoek/empede"
[dependencies] [dependencies]
anyhow = "1.0.70" anyhow = "1.0.70"
askama = { version = "0.12.0", default-features = false } askama = { version = "0.12.0", default-features = false, features = ["serde-json"] }
askama_tide = "0.15.0" askama_tide = "0.15.0"
async-std = { version = "1.12.0", features = ["attributes"] } async-std = { version = "1.12.0", features = ["attributes"] }
infer = { version = "0.13.0", default-features = false } infer = { version = "0.13.0", default-features = false }

View file

@ -57,9 +57,9 @@
<script> <script>
{% if let Some(name) = name %} {% if let Some(name) = name %}
{% if state == mpdrs::State::Play %} {% if state == mpdrs::State::Play %}
document.title = decodeURI("▶ {{ name|urlencode }} - Empede"); document.title = "▶ " + {{ name|json|safe }} + " - Empede";
{% else %} {% else %}
document.title = decodeURI("⏸ {{ name|urlencode }} - Empede"); document.title = "⏸ " + {{ name|json|safe }} + " - Empede";
{% endif %} {% endif %}
{% else %} {% else %}
document.title = "Empede"; document.title = "Empede";