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",
"num-traits",
"percent-encoding",
"serde",
"serde_json",
]
[[package]]

View File

@ -8,7 +8,7 @@ repository = "https://github.com/vijfhoek/empede"
[dependencies]
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"
async-std = { version = "1.12.0", features = ["attributes"] }
infer = { version = "0.13.0", default-features = false }

View File

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