fix(YouTube - Hide layout components): Do not hide video description music/game links if hide horizontal shelves is enabled

This commit is contained in:
LisoUseInAIKyrios 2025-04-10 19:11:11 +02:00
parent 8e91507b95
commit 3864f35501

View File

@ -454,16 +454,20 @@ public final class LayoutComponentsFilter extends Filter {
} }
private static boolean hideShelves() { private static boolean hideShelves() {
// If the player is opened while library is selected, // Horizontal shelves are used for music/game links in video descriptions,
// then filter any recommendations below the player. // such as https://youtube.com/watch?v=W8kI1na3S2M
if (PlayerType.getCurrent().isMaximizedOrFullscreen() if (PlayerType.getCurrent().isMaximizedOrFullscreen()) {
// Or if the search is active while library is selected, then also filter. return false;
|| NavigationBar.isSearchBarActive()) { }
// Must check search bar after player type, since search results
// can be in the background behind an open player.
if (NavigationBar.isSearchBarActive()) {
return true; return true;
} }
// Do not hide if the navigation back button is visible, // Do not hide if the navigation back button is visible,
// otherwise the content shelves in the YouTube Movie/Courses pages is hidden. // otherwise the content shelves in the explore/music/courses pages are hidde.
if (NavigationBar.isBackButtonVisible()) { if (NavigationBar.isBackButtonVisible()) {
return false; return false;
} }