Bountiful changes

- Use haltf in more locations
 - Fix wrong URL params
 - Rename API modules
 - Remove API routing file and move everything to general iv routing
   file
This commit is contained in:
syeopite
2021-08-23 16:28:30 -07:00
parent 39b34eece8
commit 66b45a8fe2
10 changed files with 122 additions and 119 deletions

View File

@@ -1,4 +1,4 @@
module Invidious::Routes::APIv1::Feeds
module Invidious::Routes::API::V1::Feeds
def self.trending(env)
locale = LOCALES[env.get("preferences").as(Preferences).locale]?
@@ -31,8 +31,7 @@ module Invidious::Routes::APIv1::Feeds
if !CONFIG.popular_enabled
error_message = {"error" => "Administrator has disabled this endpoint."}.to_json
env.response.status_code = 400
return error_message
haltf env, 400, error_message
end
JSON.build do |json|