mirror of
https://github.com/iv-org/invidious.git
synced 2024-12-03 12:11:22 +05:30
add Compilation symbols
This commit is contained in:
parent
8aff1d0409
commit
5fb47c5e9e
@ -627,11 +627,11 @@ default_user_preferences:
|
||||
##
|
||||
## Accepted values: A list of strings
|
||||
## Each entry can be one of: "Popular", "Trending",
|
||||
## "Subscriptions", "Playlists"
|
||||
## "Subscriptions", "Playlists", "Compilations"
|
||||
##
|
||||
## Default: ["Popular", "Trending", "Subscriptions", "Playlists"] (show all feeds)
|
||||
## Default: ["Popular", "Trending", "Subscriptions", "Playlists","Compilations"] (show all feeds)
|
||||
##
|
||||
#feed_menu: ["Popular", "Trending", "Subscriptions", "Playlists"]
|
||||
#feed_menu: ["Popular", "Trending", "Subscriptions", "Playlists","Compilations"]
|
||||
|
||||
##
|
||||
## Default feed to display on the home page.
|
||||
|
@ -413,6 +413,7 @@
|
||||
"Audio mode": "Audio mode",
|
||||
"Video mode": "Video mode",
|
||||
"Playlists": "Playlists",
|
||||
"Compilations": "Compilations",
|
||||
"search_filters_title": "Filters",
|
||||
"search_filters_date_label": "Upload date",
|
||||
"search_filters_date_option_none": "Any date",
|
||||
|
@ -8,6 +8,7 @@ require "../src/invidious/channels/*"
|
||||
require "../src/invidious/videos/caption"
|
||||
require "../src/invidious/videos"
|
||||
require "../src/invidious/playlists"
|
||||
require "../src/invidious/compilations"
|
||||
require "../src/invidious/search/ctoken"
|
||||
require "../src/invidious/trending"
|
||||
require "spectator"
|
||||
|
@ -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 %>
|
||||
|
Loading…
Reference in New Issue
Block a user