From 43b542d6974455c4fa5c349f7ced2bc318fa903c Mon Sep 17 00:00:00 2001 From: arichornlover <78001398+arichorn@users.noreply.github.com> Date: Thu, 19 Oct 2023 01:30:46 -0500 Subject: [PATCH] Option Improvements Improved 2 Options - Hide Shorts Cells - Hide Download Button under Player --- uYouPlus.xm | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/uYouPlus.xm b/uYouPlus.xm index 382ed9d..fc25091 100644 --- a/uYouPlus.xm +++ b/uYouPlus.xm @@ -797,20 +797,26 @@ static void replaceTab(YTIGuideResponse *response) { [self deleteItemsAtIndexPaths:@[indexPath]]; } - // Hide all Shorts Videos in Channels - @arichorn - if (IsEnabled(@"hideShortsFromChannel_enabled") && [result rangeOfString:@"eml.shorts-video-item"].location != NSNotFound) { - [self deleteItemsAtIndexPaths:@[indexPath]]; - } - - // Hide the Download Button under the Video Player - @arichorn - if (IsEnabled(@"hideAddToOfflineButton_enabled") && [result rangeOfString:@"id.ui.add_to_offline.button"].location != NSNotFound) { - [self deleteItemsAtIndexPaths:@[indexPath]]; + // Hide Shorts Cells (from YTLite) - @dayanch96 + if (IsEnabled(@"hideShortsCells_enabled") && ([idToRemove isEqualToString:@"eml.shorts-grid"] || [idToRemove isEqualToString:@"eml.inline_shorts"] || [idToRemove isEqualToString:@"eml.shorts-video-item"])) { + [self removeCellsAtIndexPath:indexPath]; } } return cell; } %end +// Hide the Download Button under the Video Player (Experimental) - @arichorn +%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]; + } + return result; +} +%end + // App Settings Overlay Options %group gDisableAccountSection %hook YTSettingsSectionItemManager