mirror of
https://github.com/iv-org/invidious.git
synced 2025-04-19 23:25:52 -04:00
Allow display of channel watermarks to be optional
This commit is contained in:
parent
f772058ceb
commit
a19174c7b3
@ -765,7 +765,7 @@ if (location.pathname.startsWith('/embed/')) {
|
||||
}
|
||||
|
||||
// Channel watermark
|
||||
if (video_data.watermark) {
|
||||
if (video_data.watermark && video_data.preferences.show_channel_watermark) {
|
||||
const watermark_html = `<a href="/channel/${video_data.ucid}"><img class="channel-watermark" src="${video_data.watermark.thumbnailUrl}"/></a>`;
|
||||
|
||||
player.overlay({
|
||||
|
@ -823,6 +823,15 @@ default_user_preferences:
|
||||
##
|
||||
#save_player_pos: false
|
||||
|
||||
##
|
||||
## Show the channel's watermark on the bottom-rght corner of videos
|
||||
##
|
||||
## Accepted values: true, false
|
||||
## Default: false
|
||||
##
|
||||
#show_channel_watermark: true
|
||||
|
||||
|
||||
# -----------------------------
|
||||
# Subscription feed
|
||||
# -----------------------------
|
||||
|
@ -472,6 +472,7 @@
|
||||
"user_saved_playlists": "`x` saved playlists",
|
||||
"Video unavailable": "Video unavailable",
|
||||
"preferences_save_player_pos_label": "Save playback position: ",
|
||||
"preferences_show_channel_watermark_label": "Show channel watermark: ",
|
||||
"crash_page_you_found_a_bug": "It looks like you found a bug in Invidious!",
|
||||
"crash_page_before_reporting": "Before reporting a bug, make sure that you have:",
|
||||
"crash_page_refresh": "tried to <a href=\"`x`\">refresh the page</a>",
|
||||
|
@ -44,6 +44,7 @@ struct ConfigPreferences
|
||||
property vr_mode : Bool = true
|
||||
property show_nick : Bool = true
|
||||
property save_player_pos : Bool = false
|
||||
property show_channel_watermark : Bool = true
|
||||
|
||||
def to_tuple
|
||||
{% begin %}
|
||||
|
@ -78,6 +78,10 @@ module Invidious::Routes::PreferencesRoute
|
||||
save_player_pos ||= "off"
|
||||
save_player_pos = save_player_pos == "on"
|
||||
|
||||
show_channel_watermark = env.params.body["show_channel_watermark"]?.try &.as(String)
|
||||
show_channel_watermark ||= "off"
|
||||
show_channel_watermark = show_channel_watermark == "on"
|
||||
|
||||
show_nick = env.params.body["show_nick"]?.try &.as(String)
|
||||
show_nick ||= "off"
|
||||
show_nick = show_nick == "on"
|
||||
@ -175,6 +179,7 @@ module Invidious::Routes::PreferencesRoute
|
||||
vr_mode: vr_mode,
|
||||
show_nick: show_nick,
|
||||
save_player_pos: save_player_pos,
|
||||
show_channel_watermark: show_channel_watermark,
|
||||
}.to_json)
|
||||
|
||||
if user = env.get? "user"
|
||||
|
@ -55,6 +55,7 @@ struct Preferences
|
||||
property extend_desc : Bool = CONFIG.default_user_preferences.extend_desc
|
||||
property volume : Int32 = CONFIG.default_user_preferences.volume
|
||||
property save_player_pos : Bool = CONFIG.default_user_preferences.save_player_pos
|
||||
property show_channel_watermark : Bool = CONFIG.default_user_preferences.show_channel_watermark
|
||||
|
||||
module BoolToString
|
||||
def self.to_json(value : String, json : JSON::Builder)
|
||||
|
@ -117,10 +117,15 @@
|
||||
</div>
|
||||
|
||||
<div class="pure-control-group">
|
||||
<label for="save_player_pos"><%= translate(locale, "preferences_save_player_pos_label") %></label>
|
||||
<label for="show_"><%= translate(locale, "preferences_save_player_pos_label") %></label>
|
||||
<input name="save_player_pos" id="save_player_pos" type="checkbox" <% if preferences.save_player_pos %>checked<% end %>>
|
||||
</div>
|
||||
|
||||
<div class="pure-control-group">
|
||||
<label for="show_channel_watermark"><%= translate(locale, "preferences_show_channel_watermark_label") %></label>
|
||||
<input name="show_channel_watermark" id="show_channel_watermark" type="checkbox" <% if preferences.show_channel_watermark %>checked<% end %>>
|
||||
</div>
|
||||
|
||||
<legend><%= translate(locale, "preferences_category_visual") %></legend>
|
||||
|
||||
<div class="pure-control-group">
|
||||
|
Loading…
x
Reference in New Issue
Block a user