-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
feat: Implement channel blocking feature (#12647) #12787
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
- Add BlockedChannelsManager utility class for local storage using SharedPreferences - Implement automatic filtering of blocked channels in Trending, Search, and Recommendations - Add 'Block Channel' option in video long-press context menu with undo support - Create Blocked Channels management screen in Settings > Content - Add comprehensive string resources for the feature - Update gradle.properties to use Java 17 for build compatibility Features: * BlockedChannelsManager: Manages blocked channel IDs via SharedPreferences * InfoListAdapter: Filters out videos from blocked channels automatically * StreamDialogDefaultEntry: New BLOCK_CHANNEL entry with Snackbar undo * BlockedChannelsFragment: UI for viewing and managing blocked channels * Settings integration: Accessible via Settings > Content > Blocked Channels Tested: - Debug APK build successful - All code passes checkstyle and ktlint validation - Feature follows MVVM architecture and NewPipe coding standards
|
Hi maintainers 👋 This PR fully implements feature request #12647 — Block Channels. Summary
The feature follows MVVM + NewPipe coding standards and uses existing components cleanly. Would appreciate a review whenever convenient 🙏 |
TobiGr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello and thank you for the PR.
- Please do not open AI generated PRs. They lack the required info and code quality.
- Feature requests should target the refactor branch because the app is ondergoing a rewrite and the dev branch is only used for fixes.
- Please test your changes on different screen sizes (phones, tablets, TV)
- Ensure that our theme is used, the texts are all readable and the contrast is good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Display the channel name and not the URL. Fix the button size and color.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blocked channels should be stored in their own DB table with url and name so that the name can be displayed to the user.
| // Unblock the channel | ||
| BlockedChannelsManager.INSTANCE.unblockChannel( | ||
| fragment.requireContext(), uploaderUrl); | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.setActionTextColor(Color.YELLOW)
Hi @TobiGr, thanks for the review and the clear feedback. About AI usage: The code in this PR is entirely written by hand, without AI code generation. AI was only used to help with documentation and writing clearer messages, not for producing or modifying the actual code. Target branch: Understood about using the refactor branch for feature work. The next update for this feature will be adjusted to go through the refactor branch instead of dev. Testing and screen sizes: This feature has already been tested on different screen sizes, including phones and a Samsung tablet, and it behaved correctly. After applying the requested changes, it will be tested again on multiple devices (phones, tablets, and TV where possible) to confirm everything still works as expected. UI and readability: The UI will be updated as requested: the blocked list will display the channel name instead of the URL, the button size and color will be adjusted, and the app theme will be respected. Extra care will be taken so that all text is clearly visible and the contrast is good on all supported themes. |
|
Thanks for implementing this feature! With ai channels spreading like cancer this feature gets more important with each passing day... Will the list of blocked channels be ex- and importable? E.g. ex-/imported together with the settings? |
What is it?
Description of the changes in your PR
BlockedChannelsManagerutility class for local storage using SharedPreferencesgradle.propertiesto use Java 17 for build compatibilityBefore/After Screenshots or Screen Record
Before:


After:



Shows new “Block Channel” option in the video overflow menu, and “Blocked Channels” section under Settings → Content.
Fixes the following issue(s)
Relies on the following changes
APK testing
The APK can be found by going to the Checks tab below the title.
On the left pane, click CI, scroll down to artifacts, and click app to download the debug APK of this PR. This is also tested in Samsung Tablet
Due diligence