Add Compilation symbols until "Compilations" appears in feeds menu

This commit is contained in:
broquemonsieur 2023-06-07 01:11:15 -07:00
parent 5fb47c5e9e
commit d0a3c994f4
7 changed files with 16 additions and 3 deletions

1
.gitignore vendored
View File

@ -7,3 +7,4 @@
/invidious
/sentry
/config/config.yml
.DS_Store

View File

@ -631,7 +631,7 @@ default_user_preferences:
##
## Default: ["Popular", "Trending", "Subscriptions", "Playlists", "Compilations"] (show all feeds)
##
#feed_menu: ["Popular", "Trending", "Subscriptions", "Playlists","Compilations"]
feed_menu: ["Popular", "Trending", "Subscriptions", "Playlists", "Compilations"]
##
## Default feed to display on the home page.

View File

@ -0,0 +1,2 @@
module Invidious::Routes::Compilations
end

View File

@ -6,6 +6,8 @@ module Invidious::Routes::Feeds
end
def self.compilations(env)
locale = env.get("preferences").as(Preferences).locale
templated "feeds/compilations"
end

View File

@ -186,7 +186,7 @@ module Invidious::Routes::PreferencesRoute
CONFIG.default_user_preferences.default_home = env.params.body["admin_default_home"]?.try &.as(String) || CONFIG.default_user_preferences.default_home
admin_feed_menu = [] of String
4.times do |index|
5.times do |index|
option = env.params.body["admin_feed_menu[#{index}]"]?.try &.as(String) || ""
if !option.empty?
admin_feed_menu << option

View File

@ -0,0 +1,6 @@
<% title = HTML.escape(compilation.title) %>
<% author = HTML.escape(compilation.author) %>
<% content_for "header" do %>
<title><%= title %> - Invidious</title>
<% end %>

View File

@ -2,3 +2,5 @@
<title><%= translate(locale, "Compilations") %> - Invidious</title>
<% end %>
<%= rendered "components/feed_menu" %>