mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-05-21 00:37:10 +02:00
fix(YouTube - Hide layout components): Fix Hide video recommendation labels
(#4956)
This commit is contained in:
parent
543cc85220
commit
ae05ac3815
@ -34,8 +34,6 @@ public final class LayoutComponentsFilter extends Filter {
|
|||||||
private final StringFilterGroup notifyMe;
|
private final StringFilterGroup notifyMe;
|
||||||
private final StringFilterGroup singleItemInformationPanel;
|
private final StringFilterGroup singleItemInformationPanel;
|
||||||
private final StringFilterGroup expandableMetadata;
|
private final StringFilterGroup expandableMetadata;
|
||||||
private final ByteArrayFilterGroup searchResultRecommendations;
|
|
||||||
private final StringFilterGroup searchResultVideo;
|
|
||||||
private final StringFilterGroup compactChannelBarInner;
|
private final StringFilterGroup compactChannelBarInner;
|
||||||
private final StringFilterGroup compactChannelBarInnerButton;
|
private final StringFilterGroup compactChannelBarInnerButton;
|
||||||
private final ByteArrayFilterGroup joinMembershipButton;
|
private final ByteArrayFilterGroup joinMembershipButton;
|
||||||
@ -233,14 +231,9 @@ public final class LayoutComponentsFilter extends Filter {
|
|||||||
"mixed_content_shelf"
|
"mixed_content_shelf"
|
||||||
);
|
);
|
||||||
|
|
||||||
searchResultVideo = new StringFilterGroup(
|
final var searchResultRecommendationLabels = new StringFilterGroup(
|
||||||
Settings.HIDE_SEARCH_RESULT_RECOMMENDATIONS,
|
Settings.HIDE_SEARCH_RESULT_RECOMMENDATION_LABELS,
|
||||||
"search_video_with_context.eml"
|
"endorsement_header_footer.eml"
|
||||||
);
|
|
||||||
|
|
||||||
searchResultRecommendations = new ByteArrayFilterGroup(
|
|
||||||
Settings.HIDE_SEARCH_RESULT_RECOMMENDATIONS,
|
|
||||||
"endorsement_header_footer"
|
|
||||||
);
|
);
|
||||||
|
|
||||||
horizontalShelves = new StringFilterGroup(
|
horizontalShelves = new StringFilterGroup(
|
||||||
@ -258,7 +251,7 @@ public final class LayoutComponentsFilter extends Filter {
|
|||||||
compactChannelBar,
|
compactChannelBar,
|
||||||
communityPosts,
|
communityPosts,
|
||||||
paidPromotion,
|
paidPromotion,
|
||||||
searchResultVideo,
|
searchResultRecommendationLabels,
|
||||||
latestPosts,
|
latestPosts,
|
||||||
channelWatermark,
|
channelWatermark,
|
||||||
communityGuidelines,
|
communityGuidelines,
|
||||||
@ -300,13 +293,6 @@ public final class LayoutComponentsFilter extends Filter {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (matchedGroup == searchResultVideo) {
|
|
||||||
if (searchResultRecommendations.check(protobufBufferArray).isFiltered()) {
|
|
||||||
return super.isFiltered(identifier, path, protobufBufferArray, matchedGroup, contentType, contentIndex);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// The groups are excluded from the filter due to the exceptions list below.
|
// The groups are excluded from the filter due to the exceptions list below.
|
||||||
// Filter them separately here.
|
// Filter them separately here.
|
||||||
if (matchedGroup == notifyMe || matchedGroup == inFeedSurvey || matchedGroup == expandableMetadata)
|
if (matchedGroup == notifyMe || matchedGroup == inFeedSurvey || matchedGroup == expandableMetadata)
|
||||||
|
@ -103,7 +103,7 @@ public class Settings extends BaseSettings {
|
|||||||
public static final BooleanSetting HIDE_MOVIES_SECTION = new BooleanSetting("revanced_hide_movies_section", TRUE);
|
public static final BooleanSetting HIDE_MOVIES_SECTION = new BooleanSetting("revanced_hide_movies_section", TRUE);
|
||||||
public static final BooleanSetting HIDE_NOTIFY_ME_BUTTON = new BooleanSetting("revanced_hide_notify_me_button", TRUE);
|
public static final BooleanSetting HIDE_NOTIFY_ME_BUTTON = new BooleanSetting("revanced_hide_notify_me_button", TRUE);
|
||||||
public static final BooleanSetting HIDE_PLAYABLES = new BooleanSetting("revanced_hide_playables", TRUE);
|
public static final BooleanSetting HIDE_PLAYABLES = new BooleanSetting("revanced_hide_playables", TRUE);
|
||||||
public static final BooleanSetting HIDE_SEARCH_RESULT_RECOMMENDATIONS = new BooleanSetting("revanced_hide_search_result_recommendations", TRUE);
|
public static final BooleanSetting HIDE_SEARCH_RESULT_RECOMMENDATION_LABELS = new BooleanSetting("revanced_hide_search_result_recommendation_labels", TRUE);
|
||||||
public static final BooleanSetting HIDE_SHOW_MORE_BUTTON = new BooleanSetting("revanced_hide_show_more_button", TRUE, true);
|
public static final BooleanSetting HIDE_SHOW_MORE_BUTTON = new BooleanSetting("revanced_hide_show_more_button", TRUE, true);
|
||||||
// Alternative thumbnails
|
// Alternative thumbnails
|
||||||
public static final EnumSetting<ThumbnailOption> ALT_THUMBNAIL_HOME = new EnumSetting<>("revanced_alt_thumbnail_home", ThumbnailOption.ORIGINAL);
|
public static final EnumSetting<ThumbnailOption> ALT_THUMBNAIL_HOME = new EnumSetting<>("revanced_alt_thumbnail_home", ThumbnailOption.ORIGINAL);
|
||||||
|
@ -222,7 +222,7 @@ val hideLayoutComponentsPatch = bytecodePatch(
|
|||||||
SwitchPreference("revanced_hide_movies_section"),
|
SwitchPreference("revanced_hide_movies_section"),
|
||||||
SwitchPreference("revanced_hide_notify_me_button"),
|
SwitchPreference("revanced_hide_notify_me_button"),
|
||||||
SwitchPreference("revanced_hide_playables"),
|
SwitchPreference("revanced_hide_playables"),
|
||||||
SwitchPreference("revanced_hide_search_result_recommendations"),
|
SwitchPreference("revanced_hide_search_result_recommendation_labels"),
|
||||||
SwitchPreference("revanced_hide_show_more_button"),
|
SwitchPreference("revanced_hide_show_more_button"),
|
||||||
SwitchPreference("revanced_hide_doodles"),
|
SwitchPreference("revanced_hide_doodles"),
|
||||||
)
|
)
|
||||||
|
@ -210,10 +210,10 @@ You will not be notified of any unexpected events."</string>
|
|||||||
<string name="revanced_hide_notify_me_button_title">Hide \'Notify me\' button</string>
|
<string name="revanced_hide_notify_me_button_title">Hide \'Notify me\' button</string>
|
||||||
<string name="revanced_hide_notify_me_button_summary_on">Button is hidden</string>
|
<string name="revanced_hide_notify_me_button_summary_on">Button is hidden</string>
|
||||||
<string name="revanced_hide_notify_me_button_summary_off">Button is shown</string>
|
<string name="revanced_hide_notify_me_button_summary_off">Button is shown</string>
|
||||||
<!-- 'People also watched' should be translated using the same localized wording YouTube displays. -->
|
<!-- 'People also watched' and 'You might also like' should be translated using the same localized wording YouTube displays. -->
|
||||||
<string name="revanced_hide_search_result_recommendations_title">Hide \'People also watched\' label</string>
|
<string name="revanced_hide_search_result_recommendation_labels_title">Hide video recommendation labels</string>
|
||||||
<string name="revanced_hide_search_result_recommendations_summary_on">Label is hidden</string>
|
<string name="revanced_hide_search_result_recommendation_labels_summary_on">\'People also watched\' and \'You might also like\' labels are hidden</string>
|
||||||
<string name="revanced_hide_search_result_recommendations_summary_off">Label is shown</string>
|
<string name="revanced_hide_search_result_recommendation_labels_summary_off">\'People also watched\' and \'You might also like\' labels are shown</string>
|
||||||
<!-- 'Show more' should be translated with the same localized wording that YouTube displays.
|
<!-- 'Show more' should be translated with the same localized wording that YouTube displays.
|
||||||
This button usually appears when searching for a YT creator. -->
|
This button usually appears when searching for a YT creator. -->
|
||||||
<string name="revanced_hide_show_more_button_title">Hide \'Show more\' button</string>
|
<string name="revanced_hide_show_more_button_title">Hide \'Show more\' button</string>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user