Skip to content
This repository was archived by the owner on Dec 11, 2024. It is now read-only.

Commit

Permalink
fix(YouTube - Hide feed components): Hide carousel shelf setting so…
Browse files Browse the repository at this point in the history
…metimes hides the Watch history in the You tab
  • Loading branch information
inotia00 authored and anddea committed Jul 29, 2024
1 parent ddf22bb commit 0732b8c
Showing 1 changed file with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@

import androidx.annotation.Nullable;

import org.apache.commons.lang3.StringUtils;

import app.revanced.integrations.shared.patches.components.ByteArrayFilterGroup;
import app.revanced.integrations.shared.patches.components.Filter;
import app.revanced.integrations.shared.patches.components.StringFilterGroup;
import app.revanced.integrations.shared.patches.components.StringFilterGroupList;
import app.revanced.integrations.shared.utils.Logger;
import app.revanced.integrations.shared.utils.StringTrieSearch;
import app.revanced.integrations.youtube.settings.Settings;
import app.revanced.integrations.youtube.shared.RootView;
Expand Down Expand Up @@ -225,17 +224,17 @@ private static boolean hideShelves() {
return true;
}

NavigationButton selectedNavButton = NavigationButton.getSelectedNavigationButton();
if (selectedNavButton != null && !selectedNavButton.isLibraryOrYouTab()) {
return true;
}

// Check browseId last.
// Only filter in home feed, search results, playlist.
final String browseId = RootView.getBrowseId();
Logger.printInfo(() -> "browseId: " + browseId);

if (StringUtils.startsWithAny(browseId, BROWSE_ID_DEFAULT, BROWSE_ID_PLAYLIST)) {
return true;
} else if (browseId.isEmpty()) {
NavigationButton selectedNavButton = NavigationButton.getSelectedNavigationButton();
return selectedNavButton != null && !selectedNavButton.isLibraryOrYouTab();
}
return false;
return browseId.startsWith(BROWSE_ID_PLAYLIST);
}

@Override
Expand Down

0 comments on commit 0732b8c

Please sign in to comment.