From 656ca17ffc67cae7012436e5cddd7112b73fc450 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sun, 28 Apr 2024 21:59:22 +0400 Subject: [PATCH] fix(YouTube - Hide Shorts components): Hide Shorts in search result horizontal shelves (#625) --- .../youtube/patches/components/ShortsFilter.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/app/revanced/integrations/youtube/patches/components/ShortsFilter.java b/app/src/main/java/app/revanced/integrations/youtube/patches/components/ShortsFilter.java index afb5b76892..3303d1cc26 100644 --- a/app/src/main/java/app/revanced/integrations/youtube/patches/components/ShortsFilter.java +++ b/app/src/main/java/app/revanced/integrations/youtube/patches/components/ShortsFilter.java @@ -69,8 +69,12 @@ public ShortsFilter() { // Path components. // - // Shorts that appear in the feed/search when the device is using tablet layout. - shortsCompactFeedVideoPath = new StringFilterGroup(null, "compact_video.eml"); + shortsCompactFeedVideoPath = new StringFilterGroup(null, + // Shorts that appear in the feed/search when the device is using tablet layout. + "compact_video.eml", + // Search results that appear in a horizontal shelf. + "video_card.eml"); + // Filter out items that use the 'frame0' thumbnail. // This is a valid thumbnail for both regular videos and Shorts, // but it appears these thumbnails are used only for Shorts. @@ -217,8 +221,7 @@ boolean isFiltered(@Nullable String identifier, String path, byte[] protobufBuff } if (matchedGroup == shortsCompactFeedVideoPath) { - if (shouldHideShortsFeedItems() && contentIndex == 0 - && shortsCompactFeedVideoBuffer.check(protobufBufferArray).isFiltered()) { + if (shouldHideShortsFeedItems() && shortsCompactFeedVideoBuffer.check(protobufBufferArray).isFiltered()) { return super.isFiltered(identifier, path, protobufBufferArray, matchedGroup, contentType, contentIndex); } return false;