API: Add bitrate to formatStreams too (#4590)

Before this PR, the bitrate was only returned for the 'adaptiveFormats'.
They are now also returned the 'formatStreams'.

No linked issue
pull/4591/merge
Samantaz Fox 1 month ago
commit 8eaaeb1c74
No known key found for this signature in database
GPG Key ID: F42821059186176E

@ -161,6 +161,8 @@ module Invidious::JSONify::APIv1
json.field "type", fmt["mimeType"]
json.field "quality", fmt["quality"]
json.field "bitrate", fmt["bitrate"].as_i.to_s if fmt["bitrate"]?
fmt_info = Invidious::Videos::Formats.itag_to_metadata?(fmt["itag"])
if fmt_info
fps = fmt_info["fps"]?.try &.to_i || fmt["fps"]?.try &.as_i || 30

Loading…
Cancel
Save