mirror of
https://github.com/iv-org/invidious.git
synced 2025-05-31 14:11:54 +05:30
add Compilation symbols
This commit is contained in:
@@ -121,7 +121,7 @@ Kemal.config.extra_options do |parser|
|
||||
puts SOFTWARE.to_pretty_json
|
||||
exit
|
||||
end
|
||||
parser.on("--migrate", "Run any migrations (beta, use at your own risk!!") do
|
||||
parser.on("--migrate", "Run any migrations (beta, use at your own risk!!)") do
|
||||
Invidious::Database::Migrator.new(PG_DB).migrate
|
||||
exit
|
||||
end
|
||||
|
@@ -5,6 +5,10 @@ module Invidious::Routes::Feeds
|
||||
env.redirect "/feed/playlists"
|
||||
end
|
||||
|
||||
def self.compilations(env)
|
||||
templated "feeds/compilations"
|
||||
end
|
||||
|
||||
def self.playlists(env)
|
||||
locale = env.get("preferences").as(Preferences).locale
|
||||
|
||||
|
@@ -23,6 +23,12 @@ module Invidious::Routes::Misc
|
||||
else
|
||||
env.redirect "/feed/popular"
|
||||
end
|
||||
when "Compilations"
|
||||
if user
|
||||
env.redirect "/feed/compilations"
|
||||
else
|
||||
env.redirect "/feed/popular"
|
||||
end
|
||||
else
|
||||
templated "search_homepage", navbar_search: false
|
||||
end
|
||||
|
@@ -99,7 +99,7 @@ module Invidious::Routes::PreferencesRoute
|
||||
default_home = env.params.body["default_home"]?.try &.as(String) || CONFIG.default_user_preferences.default_home
|
||||
|
||||
feed_menu = [] of String
|
||||
4.times do |index|
|
||||
5.times do |index|
|
||||
option = env.params.body["feed_menu[#{index}]"]?.try &.as(String) || ""
|
||||
if !option.empty?
|
||||
feed_menu << option
|
||||
|
@@ -99,6 +99,7 @@ module Invidious::Routing
|
||||
get "/feed/popular", Routes::Feeds, :popular
|
||||
get "/feed/trending", Routes::Feeds, :trending
|
||||
get "/feed/subscriptions", Routes::Feeds, :subscriptions
|
||||
get "/feed/compilations", Routes::Feeds, :compilations
|
||||
get "/feed/history", Routes::Feeds, :history
|
||||
|
||||
# RSS Feeds
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<div class="feed-menu">
|
||||
<% feed_menu = env.get("preferences").as(Preferences).feed_menu.dup %>
|
||||
<% if !env.get?("user") %>
|
||||
<% feed_menu.reject! {|item| {"Subscriptions", "Playlists"}.includes? item} %>
|
||||
<% feed_menu.reject! {|item| {"Subscriptions", "Playlists", "Compilations"}.includes? item} %>
|
||||
<% end %>
|
||||
<% feed_menu.each do |feed| %>
|
||||
<a href="/feed/<%= feed.downcase %>" class="feed-menu-item pure-menu-heading">
|
||||
|
4
src/invidious/views/feeds/compilations.ecr
Normal file
4
src/invidious/views/feeds/compilations.ecr
Normal file
@@ -0,0 +1,4 @@
|
||||
<% content_for "header" do %>
|
||||
<title><%= translate(locale, "Compilations") %> - Invidious</title>
|
||||
<% end %>
|
||||
|
@@ -165,7 +165,7 @@
|
||||
</div>
|
||||
|
||||
<% if env.get?("user") %>
|
||||
<% feed_options = {"", "Popular", "Trending", "Subscriptions", "Playlists"} %>
|
||||
<% feed_options = {"", "Popular", "Trending", "Subscriptions", "Playlists","Compilations"} %>
|
||||
<% else %>
|
||||
<% feed_options = {"", "Popular", "Trending"} %>
|
||||
<% end %>
|
||||
|
Reference in New Issue
Block a user