mirror of https://github.com/iv-org/invidious.git
Compare commits
3 Commits
e613e3c08c
...
e0f20b0641
Author | SHA1 | Date |
---|---|---|
Richard Lora | e0f20b0641 | |
Richard Lora | 3abf21625c | |
Richard Lora | 5fa293541b |
|
@ -6,7 +6,7 @@ module Invidious::Routes::API::V1::Feeds
|
||||||
|
|
||||||
if !CONFIG.trending_enabled
|
if !CONFIG.trending_enabled
|
||||||
error_message = {"error" => "Administrator has disabled this endpoint."}.to_json
|
error_message = {"error" => "Administrator has disabled this endpoint."}.to_json
|
||||||
haltf env, 400, error_message
|
haltf env, 403, error_message
|
||||||
end
|
end
|
||||||
|
|
||||||
region = env.params.query["region"]?
|
region = env.params.query["region"]?
|
||||||
|
@ -36,7 +36,7 @@ module Invidious::Routes::API::V1::Feeds
|
||||||
|
|
||||||
if !CONFIG.popular_enabled
|
if !CONFIG.popular_enabled
|
||||||
error_message = {"error" => "Administrator has disabled this endpoint."}.to_json
|
error_message = {"error" => "Administrator has disabled this endpoint."}.to_json
|
||||||
haltf env, 400, error_message
|
haltf env, 403, error_message
|
||||||
end
|
end
|
||||||
|
|
||||||
JSON.build do |json|
|
JSON.build do |json|
|
||||||
|
|
|
@ -7,7 +7,7 @@ module Invidious::Routes::API::V1::Search
|
||||||
|
|
||||||
if !CONFIG.search_enabled
|
if !CONFIG.search_enabled
|
||||||
error_message = {"error" => "Administrator has disabled this endpoint."}.to_json
|
error_message = {"error" => "Administrator has disabled this endpoint."}.to_json
|
||||||
haltf env, 400, error_message
|
haltf env, 403, error_message
|
||||||
end
|
end
|
||||||
|
|
||||||
query = Invidious::Search::Query.new(env.params.query, :regular, region)
|
query = Invidious::Search::Query.new(env.params.query, :regular, region)
|
||||||
|
|
|
@ -44,7 +44,7 @@ module Invidious::Routes::Feeds
|
||||||
|
|
||||||
def self.trending(env)
|
def self.trending(env)
|
||||||
locale = env.get("preferences").as(Preferences).locale
|
locale = env.get("preferences").as(Preferences).locale
|
||||||
|
|
||||||
if CONFIG.trending_enabled
|
if CONFIG.trending_enabled
|
||||||
trending_type = env.params.query["type"]?
|
trending_type = env.params.query["type"]?
|
||||||
trending_type ||= "Default"
|
trending_type ||= "Default"
|
||||||
|
|
Loading…
Reference in New Issue