From 09a19356293302bf85f75bd379d9b458aed80df7 Mon Sep 17 00:00:00 2001 From: Fijxu Date: Wed, 30 Oct 2024 13:35:51 -0300 Subject: [PATCH] fixup! Videos: Fix audio tracks language. --- src/invidious/routes/api/manifest.cr | 2 +- src/invidious/routes/watch.cr | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/invidious/routes/api/manifest.cr b/src/invidious/routes/api/manifest.cr index 834c76de..c353ea75 100644 --- a/src/invidious/routes/api/manifest.cr +++ b/src/invidious/routes/api/manifest.cr @@ -56,7 +56,7 @@ module Invidious::Routes::API::Manifest end audio_streams.reject! do |z| - z if z["audioTrack"]["audioIsDefault"].as_bool == false + z if z.dig?("audioTrack", "audioIsDefault") == false end manifest = XML.build(indent: " ", encoding: "UTF-8") do |xml| diff --git a/src/invidious/routes/watch.cr b/src/invidious/routes/watch.cr index 25f349a2..2d2050dd 100644 --- a/src/invidious/routes/watch.cr +++ b/src/invidious/routes/watch.cr @@ -153,11 +153,9 @@ module Invidious::Routes::Watch end audio_streams.reject! do |z| - z if z["audioTrack"]["audioIsDefault"].as_bool == false + z if z.dig?("audioTrack", "audioIsDefault") == false end - pp audio_streams - # Older videos may not have audio sources available. # We redirect here so they're not unplayable if audio_streams.empty? && !video.live_now