diff --git a/src/invidious.cr b/src/invidious.cr index 2ef89ac3..25bd3672 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -53,6 +53,11 @@ CURRENT_BRANCH = {{ "#{`git branch | sed -n '/\* /s///p'`.strip}" }} CURRENT_COMMIT = {{ "#{`git rev-list HEAD --max-count=1 --abbrev-commit`.strip}" }} CURRENT_VERSION = {{ "#{`git describe --tags --abbrev=0`.strip}" }} +# This is used to determine the `?v=` on the end of file URLs (for cache busting). We +# only need to expire modified assets, so we can use this to find the last commit that changes +# any assets +ASSET_COMMIT = {{ "#{`git rev-list HEAD --max-count=1 --abbrev-commit -- assets`.strip}" }} + SOFTWARE = { "name" => "invidious", "version" => "#{CURRENT_VERSION}-#{CURRENT_COMMIT}", @@ -1854,12 +1859,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 %(
<%= rendered "components/player_sources" %>
-
+