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 community posts in related video
Browse files Browse the repository at this point in the history
  • Loading branch information
YT-Advanced committed Feb 18, 2024
1 parent 007835c commit 5d0665e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import androidx.annotation.Nullable;

import app.revanced.integrations.youtube.settings.SettingsEnum;
import app.revanced.integrations.youtube.shared.PlayerType
import app.revanced.integrations.youtube.patches.utils.BrowseIdPatch;

/**
Expand Down Expand Up @@ -176,6 +177,8 @@ boolean isFiltered(String path, @Nullable String identifier, String allValue, by
return grayDescriptionIdentifier.check(protobufBufferArray).isFiltered();
}
if (matchedGroup == communityPosts) {
if (BrowseIdPatch.isMaximized())
return SettingsEnum.HIDE_COMMUNITY_POSTS_RELATED_VIDEO.getBoolean();
if (BrowseIdPatch.isHomeFeed())
return SettingsEnum.HIDE_COMMUNITY_POSTS_HOME.getBoolean();
return SettingsEnum.HIDE_COMMUNITY_POSTS_SUBSCRIPTIONS.getBoolean();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ public enum SettingsEnum {
HIDE_CHIPS_SHELF("revanced_hide_chips_shelf", BOOLEAN, TRUE),
HIDE_COMMUNITY_POSTS_HOME("revanced_hide_community_posts_home", BOOLEAN, TRUE),
HIDE_COMMUNITY_POSTS_SUBSCRIPTIONS("revanced_hide_community_posts_subscriptions", BOOLEAN, FALSE),
HIDE_COMMUNITY_POSTS_RELATED_VIDEO("revanced_hide_community_posts_related_video", BOOLEAN, TRUE),
HIDE_EXPANDABLE_CHIP("revanced_hide_expandable_chip", BOOLEAN, TRUE),
HIDE_FEED_SURVEY("revanced_hide_feed_survey", BOOLEAN, TRUE),
HIDE_GRAY_DESCRIPTION("revanced_hide_gray_description", BOOLEAN, TRUE),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,13 @@ enum class PlayerType {
return isNoneHiddenOrSlidingMinimized() || this == WATCH_WHILE_MINIMIZED
}

/**
* Check if the current player type is [WATCH_WHILE_MAXIMIZED].
*
* @return If a regular video is being played in maximized mode.
*/
fun isMaximized(): Boolean {
return this == WATCH_WHILE_MAXIMIZED
}

}

0 comments on commit 5d0665e

Please sign in to comment.