Views: Add "Watch on Materialious" link on videos.
All checks were successful
Invidious CI / build (push) Successful in 6m32s

This commit is contained in:
Fijxu 2024-06-28 18:17:04 -04:00
parent 162233816f
commit 3973fbe580
Signed by: Fijxu
GPG key ID: 32C1DDF333EDA6A4
4 changed files with 19 additions and 0 deletions

View file

@ -489,6 +489,7 @@
"none": "none",
"videoinfo_started_streaming_x_ago": "Started streaming `x` ago",
"videoinfo_watch_on_youTube": "Watch on YouTube",
"videoinfo_watch_on_materialious": "Watch on Materialious",
"videoinfo_youTube_embed_link": "Embed",
"videoinfo_invidious_embed_link": "Embed Link",
"download_subtitles": "Subtitles - `x` (.vtt)",

View file

@ -390,6 +390,7 @@
"search_filters_features_option_purchased": "Comprado",
"search_filters_features_option_three_sixty": "360°",
"videoinfo_watch_on_youTube": "Ver en YouTube",
"videoinfo_watch_on_materialious": "Ver en Materialious",
"preferences_save_player_pos_label": "Guardar posición de reproducción: ",
"generic_views_count_0": "{{count}} visualización",
"generic_views_count_1": "{{count}} visualizaciones",

View file

@ -153,6 +153,9 @@ class Config
# Playlist length limit
property playlist_length_limit : Int32 = 500
# Materialious redirects
property materialious_domain : String?
def disabled?(option)
case disabled = CONFIG.disable_proxy
when Bool

View file

@ -127,6 +127,20 @@ we're going to need to do it here in order to allow for translations.
(<a id="link-yt-embed" data-base-url="<%= link_yt_embed %>" href="<%= link_yt_embed %>"><%= translate(locale, "videoinfo_youTube_embed_link") %></a>)
</span>
<% if CONFIG.materialious_domain %>
<p id="watch-on-materialious">
<%-
link_materialious_watch = URI.new(scheme: "https", host: "#{CONFIG.materialious_domain}", path: "/watch", query: "v=#{video.id}")
if !plid.nil? && !continuation.nil?
link_materialious_param = URI::Params{"list" => [plid], "index" => [continuation.to_s]}
link_materialious_watch = IV::HttpServer::Utils.add_params_to_url(link_materialious_watch, link_materialious_param)
end
-%>
<a id="link-materialious-watch" data-base-url="<%= link_materialious_watch %>" href="<%= link_materialious_watch %>"><%= translate(locale, "videoinfo_watch_on_materialious") %></a>
</p>
<% end %>
<p id="watch-on-another-invidious-instance">
<%- link_iv_other = IV::Frontend::Misc.redirect_url(env) -%>
<a id="link-iv-other" data-base-url="<%= link_iv_other %>" href="<%= link_iv_other %>"><%= translate(locale, "Switch Invidious Instance") %></a>