mirror of
				https://github.com/iv-org/invidious.git
				synced 2025-11-04 06:31:57 +00:00 
			
		
		
		
	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
This commit is contained in:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user