Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Commit

Permalink
feat(YouTube - Hide layout components): Add Hide membership video s…
Browse files Browse the repository at this point in the history
…ettings
  • Loading branch information
semantic-release-bot authored and YT-Advanced committed Feb 3, 2024
1 parent 496fbb3 commit 50db31b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ public final class LayoutComponentsFilter extends Filter {
SettingsEnum.HIDE_VIDEO_WITH_LOW_VIEW,
"g-highZ"
);
private static final ByteArrayAsStringFilterGroup membershipVideoIdentifier =
new ByteArrayAsStringFilterGroup(
SettingsEnum.HIDE_HOME_FEED_MEMBERSHIP_VIDEO,
"high-ptsZ"
);
private final StringFilterGroup communityPosts;
private final StringFilterGroupList communityPostsGroupList = new StringFilterGroupList();
private final StringFilterGroup homeVideoWithContext;
Expand Down Expand Up @@ -173,7 +178,8 @@ public LayoutComponentsFilter() {
boolean isFiltered(String path, @Nullable String identifier, String allValue, byte[] protobufBufferArray,
FilterGroupList matchedList, FilterGroup matchedGroup, int matchedIndex) {
if (matchedGroup == homeVideoWithContext) {
return lowViewsVideoIdentifier.check(protobufBufferArray).isFiltered();
return (membershipVideoIdentifier.check(protobufBufferArray).isFiltered()
|| lowViewsVideoIdentifier.check(protobufBufferArray).isFiltered());
} else if (matchedGroup == searchVideoWithContext) {
return grayDescriptionIdentifier.check(protobufBufferArray).isFiltered();
} else if (matchedGroup == communityPosts) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ public enum SettingsEnum {
// Experimental Flags
HIDE_SUGGESTIONS_SHELF("revanced_hide_suggestions_shelf", BOOLEAN, FALSE, true),
HIDE_SUGGESTIONS_SHELF_METHOD("revanced_hide_suggestions_shelf_method", BOOLEAN, FALSE, true),
HIDE_HOME_FEED_MEMBERSHIP_VIDEO("revanced_hide_home_feed_membership_video", BOOLEAN, FALSE, true),
HIDE_VIDEO_WITH_GRAY_DESCRIPTION("revanced_hide_video_with_gray_description", BOOLEAN, FALSE, true),
HIDE_VIDEO_WITH_LOW_VIEW("revanced_hide_video_with_low_view", BOOLEAN, FALSE, true),

Expand Down

0 comments on commit 50db31b

Please sign in to comment.