Skip to content

Commit

Permalink
fix(YouTube - Hide Community Post): Not be hidden correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
YT-Advanced committed Mar 14, 2024
1 parent 4266135 commit 0714f4b
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,17 @@ public LayoutComponentsFilter() {
ticketShelf,
timedReactions
);

communityPostsGroupList.addAll(
new StringFilterGroup(
SettingsEnum.HIDE_COMMUNITY_POSTS_HOME,
"horizontalCollectionSwipeProtector=null"
),
new StringFilterGroup(
SettingsEnum.HIDE_COMMUNITY_POSTS_SUBSCRIPTIONS,
"heightConstraint=null"
)
);
}

@Override
Expand All @@ -173,17 +184,16 @@ boolean isFiltered(String path, @Nullable String identifier, String allValue, by
return (membershipVideoIdentifier.check(protobufBufferArray).isFiltered()
|| lowViewsVideoIdentifier.check(protobufBufferArray).isFiltered());
if (matchedGroup == searchVideoWithContext) {
BrowseIdPatch.setDefaultBrowseIdToField();
return grayDescriptionIdentifier.check(protobufBufferArray).isFiltered();
}
if (matchedGroup == communityPosts) {
if (PlayerType.getCurrent() == PlayerType.WATCH_WHILE_MAXIMIZED)
return SettingsEnum.HIDE_COMMUNITY_POSTS_RELATED_VIDEO.getBoolean();
if (!BrowseIdPatch.isVaildBrowseId()) return false;

// YouTube is testing new community post component in home feed
if (BrowseIdPatch.isHomeFeed())
return SettingsEnum.HIDE_COMMUNITY_POSTS_HOME.getBoolean();
return SettingsEnum.HIDE_COMMUNITY_POSTS_SUBSCRIPTIONS.getBoolean();
return communityPostsGroupList.check(allValue).isFiltered();
}

return super.isFiltered(path, identifier, allValue, protobufBufferArray, matchedList, matchedGroup, matchedIndex);
Expand Down

0 comments on commit 0714f4b

Please sign in to comment.