forked from midou/invidious
Extract API routes from invidious.cr (2/?)
- Video playback endpoints - Search feed api - Video info api
This commit is contained in:
13
src/invidious/routes/api/v1/misc.cr
Normal file
13
src/invidious/routes/api/v1/misc.cr
Normal file
@@ -0,0 +1,13 @@
|
||||
module Invidious::Routes::APIv1
|
||||
# Stats API endpoint for Invidious
|
||||
def self.stats(env)
|
||||
locale = LOCALES[env.get("preferences").as(Preferences).locale]?
|
||||
env.response.content_type = "application/json"
|
||||
|
||||
if !CONFIG.statistics_enabled
|
||||
return error_json(400, "Statistics are not enabled.")
|
||||
end
|
||||
|
||||
Invidious::Jobs::StatisticsRefreshJob::STATISTICS.to_json
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user