From 6936a8fb2b9af36c5a2e92159d04bc8b97ed7f7e Mon Sep 17 00:00:00 2001 From: arichornlover <78001398+arichorn@users.noreply.github.com> Date: Thu, 19 Oct 2023 02:31:18 -0500 Subject: [PATCH] Resolve some errors? (uYouPlus.xm) --- uYouPlus.xm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/uYouPlus.xm b/uYouPlus.xm index fc25091..567e32c 100644 --- a/uYouPlus.xm +++ b/uYouPlus.xm @@ -784,6 +784,9 @@ static void replaceTab(YTIGuideResponse *response) { NSString *result = [[[[asCell node] accessibilityElements] valueForKey:@"description"] componentsJoinedByString:@""]; + if ([cell respondsToSelector:@selector(node)]) { + NSString *idToRemove = [[cell node] accessibilityIdentifier]; + // 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]]; @@ -810,8 +813,14 @@ static void replaceTab(YTIGuideResponse *response) { %hook _ASDisplayView - (id)initWithElement:(ELMElement *)element { id result = %orig; - if (IsEnabled(@"hideAddToOfflineButton_enabled") && ([element respondsToSelector:@selector(identifier)] && [[element identifier] isEqualToString:@"id.ui.add_to.offline.button"]) { - [result setHidden:YES]; + if (IsEnabled(@"hideAddToOfflineButton_enabled")) { + SEL identifierSelector = NSSelectorFromString(@"identifier"); + if ([element respondsToSelector:identifierSelector]) { + NSString *identifier = [element performSelector:identifierSelector]; + if ([identifier isEqualToString:@"id.ui.add_to.offline.button"]) { + [result setHidden:YES]; + } + } } return result; }