fix(YouTube - Hide shorts components): Hide the subscribe button when paused

This commit is contained in:
oSumAtrIX 2023-10-05 03:41:52 +02:00
parent 1efd5c8315
commit 6730aaf2b8
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4

View File

@ -16,6 +16,7 @@ public final class ShortsFilter extends Filter {
private final String REEL_CHANNEL_BAR_PATH = "reel_channel_bar.eml";
private final StringFilterGroup channelBar;
private final StringFilterGroup subscribeButton;
private final StringFilterGroup soundButton;
private final StringFilterGroup infoPanel;
private final StringFilterGroup shelfHeader;
@ -53,7 +54,8 @@ public final class ShortsFilter extends Filter {
SettingsEnum.HIDE_SHORTS_JOIN_BUTTON,
"sponsor_button"
);
var subscribeButton = new StringFilterGroup(
subscribeButton = new StringFilterGroup(
SettingsEnum.HIDE_SHORTS_SUBSCRIBE_BUTTON,
"subscribe_button",
"shorts_paused_state"
@ -63,6 +65,7 @@ public final class ShortsFilter extends Filter {
SettingsEnum.HIDE_SHORTS_CHANNEL_BAR,
REEL_CHANNEL_BAR_PATH
);
soundButton = new StringFilterGroup(
SettingsEnum.HIDE_SHORTS_SOUND_BUTTON,
"reel_pivot_button"
@ -105,8 +108,11 @@ public final class ShortsFilter extends Filter {
FilterGroupList matchedList, FilterGroup matchedGroup, int matchedIndex) {
if (matchedList == pathFilterGroupList) {
// Always filter if matched.
if (matchedGroup == soundButton || matchedGroup == infoPanel || matchedGroup == channelBar)
return super.isFiltered(identifier, path, protobufBufferArray, matchedList, matchedGroup, matchedIndex);
if (matchedGroup == soundButton ||
matchedGroup == infoPanel ||
matchedGroup == channelBar ||
matchedGroup == subscribeButton
) return super.isFiltered(identifier, path, protobufBufferArray, matchedList, matchedGroup, matchedIndex);
// Video action buttons (comment, share, remix) have the same path.
if (matchedGroup == videoActionButton) {