mirror of
https://github.com/iv-org/invidious.git
synced 2025-07-28 16:28:29 +00: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
|
||||
end
|
||||
|
||||
return tracker
|
||||
return tracker.as(Hash(String, Int64 | Float64))
|
||||
end
|
||||
|
@ -80,7 +80,7 @@ module Invidious::Routes::VideoPlayback
|
||||
# Remove the Range header added previously.
|
||||
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
|
||||
|
||||
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
|
||||
# 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 {
|
||||
"version" => JSON::Any.new(Video::SCHEMA_VERSION.to_i64),
|
||||
|
Loading…
Reference in New Issue
Block a user