feat(YouTube - Comments): Add Hide Thanks button and Hide 'Comments by members' header options (#653)

This commit is contained in:
ILoveOpenSourceApplications 2024-06-09 14:44:51 +05:30 committed by GitHub
parent 376eb46f10
commit 240e805489
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 19 additions and 4 deletions

View File

@ -14,6 +14,12 @@ final class CommentsFilter extends Filter {
private final ByteArrayFilterGroup emojiPickerBufferGroup;
public CommentsFilter() {
var commentsByMembers = new StringFilterGroup(
Settings.HIDE_COMMENTS_BY_MEMBERS_HEADER,
"sponsorships_comments_header.eml",
"sponsorships_comments_footer.eml"
);
var comments = new StringFilterGroup(
Settings.HIDE_COMMENTS_SECTION,
"video_metadata_carousel",
@ -21,14 +27,19 @@ final class CommentsFilter extends Filter {
);
var previewComment = new StringFilterGroup(
Settings.HIDE_PREVIEW_COMMENT,
Settings.HIDE_COMMENTS_PREVIEW_COMMENT,
"|carousel_item",
"comments_entry_point_teaser",
"comments_entry_point_simplebox"
);
var thanksButton = new StringFilterGroup(
Settings.HIDE_COMMENTS_THANKS_BUTTON,
"super_thanks_button.eml"
);
commentComposer = new StringFilterGroup(
Settings.HIDE_COMMENT_TIMESTAMP_AND_EMOJI_BUTTONS,
Settings.HIDE_COMMENTS_TIMESTAMP_AND_EMOJI_BUTTONS,
"comment_composer.eml"
);
@ -38,8 +49,10 @@ final class CommentsFilter extends Filter {
);
addPathCallbacks(
commentsByMembers,
comments,
previewComment,
thanksButton,
commentComposer
);
}

View File

@ -147,9 +147,11 @@ public class Settings extends BaseSettings {
"org.schabi.newpipe" /* NewPipe */, parentsAny(EXTERNAL_DOWNLOADER, EXTERNAL_DOWNLOADER_ACTION_BUTTON));
// Comments
public static final BooleanSetting HIDE_PREVIEW_COMMENT = new BooleanSetting("revanced_hide_preview_comment", FALSE);
public static final BooleanSetting HIDE_COMMENTS_BY_MEMBERS_HEADER = new BooleanSetting("revanced_hide_comments_by_members_header", FALSE);
public static final BooleanSetting HIDE_COMMENTS_SECTION = new BooleanSetting("revanced_hide_comments_section", FALSE);
public static final BooleanSetting HIDE_COMMENT_TIMESTAMP_AND_EMOJI_BUTTONS = new BooleanSetting("revanced_hide_comment_timestamp_and_emoji_buttons", TRUE);
public static final BooleanSetting HIDE_COMMENTS_PREVIEW_COMMENT = new BooleanSetting("revanced_hide_comments_preview_comment", FALSE);
public static final BooleanSetting HIDE_COMMENTS_THANKS_BUTTON = new BooleanSetting("revanced_hide_comments_thanks_button", TRUE);
public static final BooleanSetting HIDE_COMMENTS_TIMESTAMP_AND_EMOJI_BUTTONS = new BooleanSetting("revanced_hide_comments_timestamp_and_emoji_buttons", TRUE);
// Description
public static final BooleanSetting HIDE_CHAPTERS = new BooleanSetting("revanced_hide_chapters", TRUE);