Updated “Hide Related Videos” Option #155

This commit is contained in:
arichornlover 2023-10-15 15:16:10 -05:00 committed by GitHub
parent 2c063e85a9
commit d870bb5123
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -750,7 +750,7 @@ static void replaceTab(YTIGuideResponse *response) {
[self removeFromSuperview];
}
// Hide the Comment Section under the Video Player - @arichorn
// Hide the Comment Section under the Video Player (1) - @arichorn
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;
self.opaque = YES;
@ -784,6 +784,11 @@ static void replaceTab(YTIGuideResponse *response) {
NSString *result = [[[[asCell node] accessibilityElements] valueForKey:@"description"] componentsJoinedByString:@""];
// Hide the Comment Section under the Video Player (2) - @arichorn
if (IsEnabled(@"hideCommentSection_enabled") && [result rangeOfString:@"id.ui.comments_entry_point_teaser"].location != NSNotFound) {
[self deleteItemsAtIndexPaths:@[indexPath]];
}
// Hide Community Posts - @arichorn
if (IsEnabled(@"hideCommunityPosts_enabled") && [result rangeOfString:@"id.ui.backstage.post"].location != NSNotFound) {
[self deleteItemsAtIndexPaths:@[indexPath]];
@ -992,6 +997,24 @@ static void replaceTab(YTIGuideResponse *response) {
%orig(arg1);
}
%end
%hook YTFullScreenEngagementOverlayView
- (void)setRelatedVideosView:(id)view {
}
- (void)updateRelatedVideosViewSafeAreaInsets {
}
- (id)relatedVideosView {
return nil;
}
%end
%hook YTFullScreenEngagementOverlayViewController
- (void)setRelatedVideosVisible:(BOOL)visible {
}
- (BOOL)relatedVideosPeekingEnabled {
return NO;
}
%end
%end
// iPhone Layout - @LillieH1000 & @arichorn