mirror of
https://github.com/iv-org/invidious.git
synced 2025-10-27 19:28:31 -05:00
Cast playback stats hash type prior to return
This commit is contained in:
parent
aa5f0a49f1
commit
971c324848
@ -223,5 +223,5 @@ def get_playback_statistic
|
|||||||
Invidious::Jobs::StatisticsRefreshJob::STATISTICS["playback"] = tracker
|
Invidious::Jobs::StatisticsRefreshJob::STATISTICS["playback"] = tracker
|
||||||
end
|
end
|
||||||
|
|
||||||
return tracker
|
return tracker.as(Hash(String, Int64 | Float64))
|
||||||
end
|
end
|
||||||
|
|||||||
@ -80,7 +80,7 @@ module Invidious::Routes::VideoPlayback
|
|||||||
# Remove the Range header added previously.
|
# Remove the Range header added previously.
|
||||||
headers.delete("Range") if range_header.nil?
|
headers.delete("Range") if range_header.nil?
|
||||||
|
|
||||||
playback_statistics = get_playback_statistic().as(Hash(String, Int64 | Float64))
|
playback_statistics = get_playback_statistic()
|
||||||
playback_statistics["totalRequests"] += 1
|
playback_statistics["totalRequests"] += 1
|
||||||
|
|
||||||
if response.status_code >= 400
|
if response.status_code >= 400
|
||||||
|
|||||||
@ -81,7 +81,7 @@ def extract_video_info(video_id : String, proxy_region : String? = nil)
|
|||||||
|
|
||||||
# Although technically not a call to /videoplayback the fact that YouTube is returning the
|
# Although technically not a call to /videoplayback the fact that YouTube is returning the
|
||||||
# wrong video means that we should count it as a failure.
|
# wrong video means that we should count it as a failure.
|
||||||
get_playback_statistic().as(Hash(String, Int64 | Float64))["totalRequests"] += 1
|
get_playback_statistic()["totalRequests"] += 1
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"version" => JSON::Any.new(Video::SCHEMA_VERSION.to_i64),
|
"version" => JSON::Any.new(Video::SCHEMA_VERSION.to_i64),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user