mirror of
https://github.com/iv-org/invidious.git
synced 2025-09-15 08:18:30 +00:00
Use PagesEnabled
struct when setting pages_enabled
The config update logic for the admin panel was not updated to use the `PagesEnabled` struct introduced in commit `e238624`
This commit is contained in:
parent
ba65e4ff25
commit
d496b6e34a
@ -79,6 +79,8 @@ struct PagesEnabled
|
||||
property popular : Bool = true
|
||||
property search : Bool = true
|
||||
|
||||
def initialize(@trending, @popular, @search); end
|
||||
|
||||
def has_key?(key : String) : Bool
|
||||
%w(trending popular search).includes?(key)
|
||||
end
|
||||
|
@ -199,12 +199,11 @@ module Invidious::Routes::PreferencesRoute
|
||||
end
|
||||
CONFIG.default_user_preferences.feed_menu = admin_feed_menu
|
||||
|
||||
pages_enabled = {
|
||||
popular: (env.params.body["popular_enabled"]?.try &.as(String) || "on") == "on",
|
||||
CONFIG.pages_enabled = PagesEnabled.new(
|
||||
popular: (env.params.body["popular_enabled"]?.try &.as(String) || "on") == "on",
|
||||
trending: (env.params.body["trending_enabled"]?.try &.as(String) || "on") == "on",
|
||||
search: (env.params.body["search_enabled"]?.try &.as(String) || "on") == "on",
|
||||
}
|
||||
CONFIG.pages_enabled = pages_enabled
|
||||
search: (env.params.body["search_enabled"]?.try &.as(String) || "on") == "on",
|
||||
)
|
||||
|
||||
captcha_enabled = env.params.body["captcha_enabled"]?.try &.as(String)
|
||||
captcha_enabled ||= "off"
|
||||
|
Loading…
Reference in New Issue
Block a user