mirror of
https://github.com/iv-org/invidious.git
synced 2025-04-28 07:50:35 +05:30
14 lines
412 B
Crystal
14 lines
412 B
Crystal
class Invidious::Routes::V1Api < Invidious::Routes::BaseRoute
|
|
# Stats API endpoint for Invidious
|
|
def 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
|