fix(YouTube - Hide Layout components): Exempt expandable chips from exceptions (#498)

Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
This commit is contained in:
nullptr 2023-10-13 20:18:42 +05:00 committed by GitHub
parent 4f50ac6c49
commit 6f79746d78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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() {
@ -114,7 +115,7 @@ public final class LayoutComponentsFilter extends Filter {
"official_card"
);
final var expandableMetadata = new StringFilterGroup(
expandableMetadata = new StringFilterGroup(
SettingsEnum.HIDE_EXPANDABLE_CHIP,
"inline_expander"
);
@ -219,7 +220,8 @@ public final class LayoutComponentsFilter extends Filter {
// 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.