From 4616f889fde864728da7529194cab0790aaaa1a9 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Wed, 8 May 2019 08:58:10 -0500 Subject: [PATCH] Add simple form of cache busting --- src/invidious.cr | 10 +++--- src/invidious/views/components/player.ecr | 4 +-- .../views/components/player_sources.ecr | 32 ++++++++--------- .../views/components/subscribe_widget.ecr | 10 +++--- src/invidious/views/embed.ecr | 4 +-- src/invidious/views/licenses.ecr | 34 +++++++++---------- src/invidious/views/template.ecr | 12 +++---- src/invidious/views/watch.ecr | 14 ++++---- 8 files changed, 60 insertions(+), 60 deletions(-) diff --git a/src/invidious.cr b/src/invidious.cr index cf0d7c46..9ba9d869 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -1845,12 +1845,12 @@ post "/data_control" do |env| sleep 20.seconds env.response.puts %() - env.response.puts %() - env.response.puts %() + env.response.puts %() + env.response.puts %() if env.get("preferences").as(Preferences).dark_mode - env.response.puts %() + env.response.puts %() else - env.response.puts %() + env.response.puts %() end env.response.puts %(

) env.response.flush @@ -5351,7 +5351,7 @@ if Kemal.config.ssl end static_headers do |response, filepath, filestat| - response.headers.add("Cache-Control", "max-age=86400") + response.headers.add("Cache-Control", "max-age=2629800") end public_folder "assets" diff --git a/src/invidious/views/components/player.ecr b/src/invidious/views/components/player.ecr index c17b5464..3520ad29 100644 --- a/src/invidious/views/components/player.ecr +++ b/src/invidious/views/components/player.ecr @@ -43,8 +43,8 @@ var player_data = { aspect_ratio: '<%= aspect_ratio %>', title: "<%= video.title.dump_unquoted %>", - description: "<%= description %>", + description: "<%= HTML.escape(description) %>", thumbnail: "<%= thumbnail %>" } - + diff --git a/src/invidious/views/components/player_sources.ecr b/src/invidious/views/components/player_sources.ecr index 2fbd41b0..ed1239cc 100644 --- a/src/invidious/views/components/player_sources.ecr +++ b/src/invidious/views/components/player_sources.ecr @@ -1,22 +1,22 @@ - - - - - - - - - - - - + + + + + + + + + + + + <% if params.annotations %> - - + + <% end %> <% if params.listen || params.quality != "dash" %> - - + + <% end %> diff --git a/src/invidious/views/components/subscribe_widget.ecr b/src/invidious/views/components/subscribe_widget.ecr index c9240098..e555d6c5 100644 --- a/src/invidious/views/components/subscribe_widget.ecr +++ b/src/invidious/views/components/subscribe_widget.ecr @@ -22,14 +22,14 @@ - + <% else %>

<%= rendered "components/player_sources" %> - + <%= HTML.escape(video.title) %> - Invidious