mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2026-01-30 18:51:17 +00:00
Add audio track info to dash manifest, if present
- language id - language display name - main/default track Sort audio formats so that main/default is first (for clients not using dash) * Note: this should be a non-breaking change; if audio track info is not availablle, the behavior does not change from current
This commit is contained in:
@@ -106,7 +106,7 @@ struct Video
|
||||
if formats = info.dig?("streamingData", "adaptiveFormats")
|
||||
return formats
|
||||
.as_a.map(&.as_h)
|
||||
.sort_by! { |f| f["width"]?.try &.as_i || 0 }
|
||||
.sort_by! { |f| f["width"]?.try &.as_i || f["audioTrack"]?.try { |a| a["audioIsDefault"]?.try { |v| v.as_bool ? -1 : 0 } } || 0 }
|
||||
else
|
||||
return [] of Hash(String, JSON::Any)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user