mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2025-12-21 10:28:50 +00:00
Fix JSON serialization
This commit is contained in:
@@ -37,11 +37,13 @@
|
||||
</video>
|
||||
|
||||
<script id="player_data" type="application/json">
|
||||
<%=
|
||||
{
|
||||
"aspect_ratio": "<%= aspect_ratio %>",
|
||||
"title": "<%= video.title.dump_unquoted %>",
|
||||
"description": "<%= HTML.escape(video.short_description) %>",
|
||||
"thumbnail": "<%= thumbnail %>"
|
||||
}
|
||||
"aspect_ratio" => aspect_ratio,
|
||||
"title" => video.title,
|
||||
"description" => HTML.escape(video.short_description),
|
||||
"thumbnail" => thumbnail
|
||||
}.to_pretty_json
|
||||
%>
|
||||
</script>
|
||||
<script src="/js/player.js?v=<%= ASSET_COMMIT %>"></script>
|
||||
|
||||
@@ -20,14 +20,16 @@
|
||||
<% end %>
|
||||
|
||||
<script id="subscribe_data" type="application/json">
|
||||
<%=
|
||||
{
|
||||
"ucid": "<%= ucid %>",
|
||||
"author": "<%= HTML.escape(author) %>",
|
||||
"sub_count_text": "<%= HTML.escape(sub_count_text) %>",
|
||||
"csrf_token": "<%= URI.encode_www_form(env.get?("csrf_token").try &.as(String) || "") %>",
|
||||
"subscribe_text": "<%= HTML.escape(translate(locale, "Subscribe")) %>",
|
||||
"unsubscribe_text": "<%= HTML.escape(translate(locale, "Unsubscribe")) %>"
|
||||
}
|
||||
"ucid" => ucid,
|
||||
"author" => HTML.escape(author),
|
||||
"sub_count_text" => HTML.escape(sub_count_text),
|
||||
"csrf_token" => URI.encode_www_form(env.get?("csrf_token").try &.as(String) || ""),
|
||||
"subscribe_text" => HTML.escape(translate(locale, "Subscribe")),
|
||||
"unsubscribe_text" => HTML.escape(translate(locale, "Unsubscribe"))
|
||||
}.to_pretty_json
|
||||
%>
|
||||
</script>
|
||||
<script src="/js/subscribe_widget.js?v=<%= ASSET_COMMIT %>"></script>
|
||||
<% else %>
|
||||
|
||||
Reference in New Issue
Block a user