Updated an Option

Previous Code appears to not work. so now I'm using this version of the code based off of YouTube Reborn.
This commit is contained in:
arichorn 2023-09-20 17:38:43 -05:00 committed by GitHub
parent 8f7a6a7a68
commit ade503ebb3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -933,20 +933,14 @@ static void replaceTab(YTIGuideResponse *response) {
%end
// Hide the Comment Section under the Video Player - @arichorn
%group gNoCommentSection
%hook YTIElementRenderer
- (NSData *)elementData {
NSArray *commentSectionIDs = @[@"id.ui.comments_entry_point_teaser", @"id.ui.comments_entry_point_simplebox", @"id.ui_video_metadata_carousel", @"id.ui.carousel_header"];
NSString *description = [self description];
for (NSString *commentSectionID in commentSectionIDs) {
if ([description containsString:commentSectionID]) {
return [NSData data];
}
}
return %orig;
%hook _ASDisplayView
- (void)didMoveToWindow {
%orig;
if ((IsEnabled(@"hideCommentSection_enabled")) && ([self.accessibilityIdentifier isEqualToString:@"id.ui.comments_entry_point_teaser"] || [self.accessibilityIdentifier isEqualToString:@"id.ui.comments_entry_point_simplebox"] || [self.accessibilityIdentifier isEqualToString:@"id.ui_video_metadata_carousel"] || [self.accessibilityIdentifier isEqualToString:@"id.ui.carousel_header"])) {
self.hidden = YES;
}
}
%end
%end
// Hide the Videos under the Video Player - @Dayanch96
%group gNoRelatedWatchNexts
@ -1074,9 +1068,6 @@ static void replaceTab(YTIGuideResponse *response) {
if (IsEnabled(@"hideHeatwaves_enabled")) {
%init(gHideHeatwaves);
}
if (IsEnabled(@"noCommentSection_enabled")) {
%init(gNoCommentSection);
}
if (IsEnabled(@"noRelatedWatchNexts_enabled")) {
%init(gNoRelatedWatchNexts);
}