Skip to content

Commit dbba9d7

Browse files
committed
Expose version in /api/v1/stats with statistic disabled
1 parent 85ba04b commit dbba9d7

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ services:
3434
dbname: invidious
3535
full_refresh: false
3636
https_only: false
37+
statistics_enabled: false
3738
domain:
3839
healthcheck:
3940
test: wget -nv --tries=1 --spider http://127.0.0.1:3000/api/v1/comments/jNQXAC9IVRw || exit 1

src/invidious/routes/api/v1/misc.cr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ module Invidious::Routes::API::V1::Misc
44
env.response.content_type = "application/json"
55

66
if !CONFIG.statistics_enabled
7-
return error_json(400, "Statistics are not enabled.")
7+
return {"software" => SOFTWARE}.to_json
8+
else
9+
return Invidious::Jobs::StatisticsRefreshJob::STATISTICS.to_json
810
end
9-
10-
Invidious::Jobs::StatisticsRefreshJob::STATISTICS.to_json
1111
end
1212

1313
# APIv1 currently uses the same logic for both

0 commit comments

Comments
 (0)