mirror of
https://github.com/iv-org/invidious.git
synced 2024-12-23 00:29:53 +05:30
Expose version in /api/v1/stats with statistic disabled
This commit is contained in:
parent
85ba04b715
commit
dbba9d7687
@ -34,6 +34,7 @@ services:
|
|||||||
dbname: invidious
|
dbname: invidious
|
||||||
full_refresh: false
|
full_refresh: false
|
||||||
https_only: false
|
https_only: false
|
||||||
|
statistics_enabled: false
|
||||||
domain:
|
domain:
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: wget -nv --tries=1 --spider http://127.0.0.1:3000/api/v1/comments/jNQXAC9IVRw || exit 1
|
test: wget -nv --tries=1 --spider http://127.0.0.1:3000/api/v1/comments/jNQXAC9IVRw || exit 1
|
||||||
|
@ -4,10 +4,10 @@ module Invidious::Routes::API::V1::Misc
|
|||||||
env.response.content_type = "application/json"
|
env.response.content_type = "application/json"
|
||||||
|
|
||||||
if !CONFIG.statistics_enabled
|
if !CONFIG.statistics_enabled
|
||||||
return error_json(400, "Statistics are not enabled.")
|
return {"software" => SOFTWARE}.to_json
|
||||||
|
else
|
||||||
|
return Invidious::Jobs::StatisticsRefreshJob::STATISTICS.to_json
|
||||||
end
|
end
|
||||||
|
|
||||||
Invidious::Jobs::StatisticsRefreshJob::STATISTICS.to_json
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# APIv1 currently uses the same logic for both
|
# APIv1 currently uses the same logic for both
|
||||||
|
Loading…
Reference in New Issue
Block a user