Add administrator option to disable proxying

This commit is contained in:
Omar Roth
2019-07-07 09:07:53 -05:00
parent 5fd3ed782f
commit 2cc25b1e6e
6 changed files with 46 additions and 9 deletions

View File

@@ -6,7 +6,7 @@
<% if params.autoplay %>autoplay<% end %>
<% if params.video_loop %>loop<% end %>
<% if params.controls %>controls<% end %>>
<% if hlsvp %>
<% if hlsvp && !CONFIG.disabled?("livestreams") %>
<source src="<%= hlsvp %>?local=true" type="application/x-mpegURL" label="livestream">
<% else %>
<% if params.listen %>

View File

@@ -35,7 +35,7 @@ function update_value(element) {
<div class="pure-control-group">
<label for="local"><%= translate(locale, "Proxy videos? ") %></label>
<input name="local" id="local" type="checkbox" <% if preferences.local %>checked<% end %>>
<input name="local" id="local" type="checkbox" <% if preferences.local && !CONFIG.disabled?("local") %>checked<% end %> <% if CONFIG.disabled?("local") %>disabled<% end %>>
</div>
<div class="pure-control-group">
@@ -56,7 +56,9 @@ function update_value(element) {
<label for="quality"><%= translate(locale, "Preferred video quality: ") %></label>
<select name="quality" id="quality">
<% {"dash", "hd720", "medium", "small"}.each do |option| %>
<option value="<%= option %>" <% if preferences.quality == option %> selected <% end %>><%= translate(locale, option) %></option>
<% if !(option == "dash" && CONFIG.disabled?("dash")) %>
<option value="<%= option %>" <% if preferences.quality == option %> selected <% end %>><%= translate(locale, option) %></option>
<% end %>
<% end %>
</select>
</div>

View File

@@ -98,7 +98,7 @@ var video_data = {
<% end %>
</p>
<% if CONFIG.dmca_content.includes? video.id %>
<% if CONFIG.dmca_content.includes?(video.id) || CONFIG.disabled?("downloads") %>
<p><%= translate(locale, "Download is disabled.") %></p>
<% else %>
<form class="pure-form pure-form-stacked" action="/latest_version" method="get" rel="noopener" target="_blank">