Skip to content

Commit

Permalink
fix(YouTube - Hide Layout components): Exempt expandable chips from e…
Browse files Browse the repository at this point in the history
…xceptions (#498)

Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
  • Loading branch information
johnconner122 and oSumAtrIX committed Oct 13, 2023
1 parent 4f50ac6 commit 6f79746
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -22,6 +22,7 @@ public final class LayoutComponentsFilter extends Filter {
private final StringFilterGroup searchResultShelfHeader;
private final StringFilterGroup inFeedSurvey;
private final StringFilterGroup notifyMe;
private final StringFilterGroup expandableMetadata;

@RequiresApi(api = Build.VERSION_CODES.N)
public LayoutComponentsFilter() {
Expand Down Expand Up @@ -114,7 +115,7 @@ public LayoutComponentsFilter() {
"official_card"
);

final var expandableMetadata = new StringFilterGroup(
expandableMetadata = new StringFilterGroup(
SettingsEnum.HIDE_EXPANDABLE_CHIP,
"inline_expander"
);
Expand Down Expand Up @@ -219,7 +220,8 @@ public boolean isFiltered(@Nullable String identifier, String path, byte[] proto

// The groups are excluded from the filter due to the exceptions list below.
// Filter them separately here.
if (matchedGroup == notifyMe || matchedGroup == inFeedSurvey) return true;
if (matchedGroup == notifyMe || matchedGroup == inFeedSurvey || matchedGroup == expandableMetadata)
return super.isFiltered(identifier, path, protobufBufferArray, matchedList, matchedGroup, matchedIndex);

if (matchedGroup != custom && exceptions.matches(path))
return false; // Exceptions are not filtered.
Expand Down

0 comments on commit 6f79746

Please sign in to comment.