summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGiuliano Macedo <giuliano.programador@gmail.com>2025-01-21 10:59:02 -0300
committersyeopite <syeopite@syeopite.dev>2025-01-22 11:01:37 -0800
commit6e3ec10d763710eb20f9f3d636a31957a02c57bb (patch)
treeee73618bad3221c5844db6e4b3085a9390895da5 /src
parentd95ae7e6a5f4df3cf7346a75e6ea8246abebe2aa (diff)
downloadinvidious-6e3ec10d763710eb20f9f3d636a31957a02c57bb.tar.gz
invidious-6e3ec10d763710eb20f9f3d636a31957a02c57bb.tar.bz2
invidious-6e3ec10d763710eb20f9f3d636a31957a02c57bb.zip
feat(manifset): improved adaptationset label
Diffstat (limited to 'src')
-rw-r--r--src/invidious/routes/api/manifest.cr3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/invidious/routes/api/manifest.cr b/src/invidious/routes/api/manifest.cr
index 09c98210..78b4906d 100644
--- a/src/invidious/routes/api/manifest.cr
+++ b/src/invidious/routes/api/manifest.cr
@@ -74,12 +74,13 @@ module Invidious::Routes::API::Manifest
lang = audio_track["id"]?.try &.as_s.split('.')[0] || "und"
is_default = audio_track.has_key?("audioIsDefault") ? audio_track["audioIsDefault"].as_bool : i == 0
displayname = audio_track["displayName"]?.try &.as_s || "Unknown"
+ bitrate = fmt["bitrate"]
# Different representations of the same audio should be groupped into one AdaptationSet.
# However, most players don't support auto quality switching, so we have to trick them
# into providing a quality selector.
# See https://github.com/iv-org/invidious/issues/3074 for more details.
- xml.element("AdaptationSet", id: i, mimeType: mime_type, startWithSAP: 1, subsegmentAlignment: true, label: displayname, lang: lang) do
+ xml.element("AdaptationSet", id: i, mimeType: mime_type, startWithSAP: 1, subsegmentAlignment: true, label: "#{displayname} [#{bitrate}k]", lang: lang) do
codecs = fmt["mimeType"].as_s.split("codecs=")[1].strip('"')
bandwidth = fmt["bitrate"].as_i
itag = fmt["itag"].as_i