From 31af58794359137a2192cd815f9affa04746e8ce Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Thu, 14 Nov 2024 01:37:14 +0400 Subject: [PATCH] refactor(YouTube - Hide mix playlist): Do not search path or buffer unless setting is enabled --- .../youtube/patches/components/LayoutComponentsFilter.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/extensions/shared/src/main/java/app/revanced/extension/youtube/patches/components/LayoutComponentsFilter.java b/extensions/shared/src/main/java/app/revanced/extension/youtube/patches/components/LayoutComponentsFilter.java index bf10416d17..a78b941bf2 100644 --- a/extensions/shared/src/main/java/app/revanced/extension/youtube/patches/components/LayoutComponentsFilter.java +++ b/extensions/shared/src/main/java/app/revanced/extension/youtube/patches/components/LayoutComponentsFilter.java @@ -31,7 +31,7 @@ public final class LayoutComponentsFilter extends Filter { "cell_description_body" ); private static final ByteArrayFilterGroup mixPlaylists = new ByteArrayFilterGroup( - Settings.HIDE_MIX_PLAYLISTS, + null, "&list=" ); @@ -344,6 +344,10 @@ boolean isFiltered(@Nullable String identifier, String path, byte[] protobufBuff */ public static boolean filterMixPlaylists(final Object conversionContext, @Nullable final byte[] bytes) { try { + if (!Settings.HIDE_MIX_PLAYLISTS.get()) { + return false; + } + if (bytes == null) { Logger.printDebug(() -> "bytes is null"); return false;