From 5011c35413aa7e07161a7040fc3f2f33ca5ea4b3 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Sat, 11 Mar 2023 16:59:58 +0100 Subject: [PATCH] Fix the preference key of disable proxy preference --- .../java/com/github/libretube/helpers/ProxyHelper.kt | 9 ++++++++- app/src/main/res/xml/audio_video_settings.xml | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/github/libretube/helpers/ProxyHelper.kt b/app/src/main/java/com/github/libretube/helpers/ProxyHelper.kt index 179394f41..34754a1a7 100644 --- a/app/src/main/java/com/github/libretube/helpers/ProxyHelper.kt +++ b/app/src/main/java/com/github/libretube/helpers/ProxyHelper.kt @@ -32,7 +32,14 @@ object ProxyHelper { * Load the YT url directly instead of the proxied Piped URL if enabled */ fun unwrapIfEnabled(url: String): String { - if (!PreferenceHelper.getBoolean(PreferenceKeys.DISABLE_VIDEO_IMAGE_PROXY, false)) return url + if (!PreferenceHelper.getBoolean( + PreferenceKeys.DISABLE_VIDEO_IMAGE_PROXY, + false + ) + ) { + return url + } + return url.toHttpUrlOrNull()?.let { it.newBuilder() .host(it.queryParameter("host").orEmpty()) diff --git a/app/src/main/res/xml/audio_video_settings.xml b/app/src/main/res/xml/audio_video_settings.xml index b37529fef..26321a671 100644 --- a/app/src/main/res/xml/audio_video_settings.xml +++ b/app/src/main/res/xml/audio_video_settings.xml @@ -101,7 +101,7 @@ android:icon="@drawable/ic_server" android:summary="@string/disable_proxy_summary" android:title="@string/disable_proxy" - app:key="lbry_hls" /> + app:key="disable_video_image_proxy" />