Skip to content

Commit

Permalink
fix(YouTube - Hide Shorts components): Hide Shorts in search result h…
Browse files Browse the repository at this point in the history
…orizontal shelves (ReVanced#625)
  • Loading branch information
LisoUseInAIKyrios committed Apr 28, 2024
1 parent 973e51e commit 656ca17
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 656ca17

Please sign in to comment.