feat: add option to force proxying of videos
Some checks failed
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.13.2, true) (push) Has been cancelled
Build and release container directly from master / release (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.12.1, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.14.0, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.15.0, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (nightly, false) (push) Has been cancelled
Invidious CI / build-docker (push) Has been cancelled
Invidious CI / build-docker-arm64 (push) Has been cancelled
Invidious CI / lint (push) Has been cancelled

This commit is contained in:
Fijxu 2025-03-24 21:15:38 -03:00
parent 7aba1f7ba3
commit 7c9f79e1f1
3 changed files with 9 additions and 2 deletions

View File

@ -239,6 +239,8 @@ class Config
property check_backends_interval : Int32 = 30 property check_backends_interval : Int32 = 30
property force_local : Bool = true
{% if flag?(:linux) %} {% if flag?(:linux) %}
property reload_config_automatically : Bool = true property reload_config_automatically : Bool = true
{% end %} {% end %}

View File

@ -109,7 +109,9 @@ def process_video_params(query, preferences)
quality = "high" quality = "high"
end end
if CONFIG.disabled?("local") && local if CONFIG.force_local
local = true
elsif CONFIG.disabled?("local") && local
local = false local = false
end end

View File

@ -34,7 +34,10 @@
<div class="pure-control-group"> <div class="pure-control-group">
<label for="local"><%= translate(locale, "preferences_local_label") %></label> <label for="local"><%= translate(locale, "preferences_local_label") %></label>
<input name="local" id="local" type="checkbox" <% if preferences.local && !CONFIG.disabled?("local") %>checked<% end %> <% if CONFIG.disabled?("local") %>disabled<% end %>> <input name="local" id="local" type="checkbox" <% if CONFIG.force_local %>disabled="" <% end %><% if preferences.local && !CONFIG.disabled?("local") %>checked<% end %> <% if CONFIG.disabled?("local") %>disabled<% end %>>
<% if CONFIG.force_local %>
<label for="local">(All videos are proxied by default)</label>
<% end %>
</div> </div>
<div class="pure-control-group"> <div class="pure-control-group">