mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-04-21 16:02:00 +00:00
Limited the Option Hide all Videos under Player
`Hide all Videos under Player` will no longer work on an iPad if it’s used in Landscape mode.
This commit is contained in:
parent
fdb474719e
commit
e3a347630e
1 changed files with 14 additions and 9 deletions
|
|
@ -1223,6 +1223,7 @@ NSData *cellDividerData;
|
||||||
%hook YTIElementRenderer
|
%hook YTIElementRenderer
|
||||||
- (NSData *)elementData {
|
- (NSData *)elementData {
|
||||||
NSString *description = [self description];
|
NSString *description = [self description];
|
||||||
|
/*
|
||||||
if ([NSUserDefaults.standardUserDefaults boolForKey:@"removeShortsCell"]) { // uYou (Hide Shorts Cells)
|
if ([NSUserDefaults.standardUserDefaults boolForKey:@"removeShortsCell"]) { // uYou (Hide Shorts Cells)
|
||||||
if ([description containsString:@"shorts_shelf.eml"] || [description containsString:@"#shorts"] || [description containsString:@"shorts_video_cell.eml"] || [description containsString:@"6Shorts"]) {
|
if ([description containsString:@"shorts_shelf.eml"] || [description containsString:@"#shorts"] || [description containsString:@"shorts_video_cell.eml"] || [description containsString:@"6Shorts"]) {
|
||||||
if (![description containsString:@"history*"]) {
|
if (![description containsString:@"history*"]) {
|
||||||
|
|
@ -1231,6 +1232,7 @@ NSData *cellDividerData;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
// Hide Community Posts @michael-winay & @arichornlover
|
// Hide Community Posts @michael-winay & @arichornlover
|
||||||
if (IS_ENABLED(@"hideCommunityPosts_enabled")) {
|
if (IS_ENABLED(@"hideCommunityPosts_enabled")) {
|
||||||
if ([description containsString:@"post_base_wrapper.eml"]) {
|
if ([description containsString:@"post_base_wrapper.eml"]) {
|
||||||
|
|
@ -1238,12 +1240,14 @@ NSData *cellDividerData;
|
||||||
return cellDividerData;
|
return cellDividerData;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
// etc. - @Dayanch96
|
// etc. - @Dayanch96
|
||||||
BOOL hasShorts = ([description containsString:@"shorts_shelf.eml"] || [description containsString:@"shorts_video_cell.eml"] || [description containsString:@"6Shorts"]) && ![description containsString:@"history*"];
|
BOOL hasShorts = ([description containsString:@"shorts_shelf.eml"] || [description containsString:@"shorts_video_cell.eml"] || [description containsString:@"6Shorts"]) && ![description containsString:@"history*"];
|
||||||
BOOL hasShortsInHistory = [description containsString:@"compact_video.eml"] && [description containsString:@"youtube_shorts_"];
|
BOOL hasShortsInHistory = [description containsString:@"compact_video.eml"] && [description containsString:@"youtube_shorts_"];
|
||||||
|
|
||||||
if (hasShorts || hasShortsInHistory) return cellDividerData;
|
if (hasShorts || hasShortsInHistory) return cellDividerData;
|
||||||
return %orig;
|
return %orig;
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
|
|
||||||
|
|
@ -1270,16 +1274,12 @@ NSData *cellDividerData;
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
|
|
||||||
// Hide the (Connect / Thanks / Save / Report) Buttons under the Video Player - 17.33.2 and up - @arichornlover (inspired by @PoomSmart's version) DEPRECATED METHOD ⚠️
|
// Hide the (Connect / Thanks / Save / Report) Buttons under the Video Player - 17.33.2 and up - @arichornlover (inspired by @PoomSmart's version) LEGACY METHOD ⚠️
|
||||||
%hook _ASDisplayView
|
%hook _ASDisplayView
|
||||||
- (void)layoutSubviews {
|
- (void)layoutSubviews {
|
||||||
%orig;
|
%orig;
|
||||||
BOOL hideConnectButton = IS_ENABLED(@"hideConnectButton_enabled");
|
BOOL hideConnectButton = IS_ENABLED(@"hideConnectButton_enabled");
|
||||||
// BOOL hideShareButton = IS_ENABLED(@"hideShareButton_enabled"); // OLD
|
|
||||||
// BOOL hideRemixButton = IS_ENABLED(@"hideRemixButton_enabled"); // OLD
|
|
||||||
BOOL hideThanksButton = IS_ENABLED(@"hideThanksButton_enabled");
|
BOOL hideThanksButton = IS_ENABLED(@"hideThanksButton_enabled");
|
||||||
// BOOL hideAddToOfflineButton = IS_ENABLED(@"hideAddToOfflineButton_enabled"); // OLD
|
|
||||||
// BOOL hideClipButton = IS_ENABLED(@"hideClipButton_enabled"); // OLD
|
|
||||||
BOOL hideSaveToPlaylistButton = IS_ENABLED(@"hideSaveToPlaylistButton_enabled");
|
BOOL hideSaveToPlaylistButton = IS_ENABLED(@"hideSaveToPlaylistButton_enabled");
|
||||||
BOOL hideReportButton = IS_ENABLED(@"hideReportButton_enabled");
|
BOOL hideReportButton = IS_ENABLED(@"hideReportButton_enabled");
|
||||||
|
|
||||||
|
|
@ -1297,7 +1297,7 @@ NSData *cellDividerData;
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
|
|
||||||
// Hide the (Connect / Share / Remix / Thanks / Download / Clip / Save / Report) Buttons under the Video Player - 17.33.2 and up - @PoomSmart (inspired by @arichornlover) - NEW METHOD
|
// Hide the (Connect / Share / Remix / Thanks / Download / Clip / Save / Report) Buttons under the Video Player - 17.33.2 and up - @PoomSmart (inspired by @arichornlover) - METHOD BROKE Server-Side on May 14th 2024
|
||||||
static BOOL findCell(ASNodeController *nodeController, NSArray <NSString *> *identifiers) {
|
static BOOL findCell(ASNodeController *nodeController, NSArray <NSString *> *identifiers) {
|
||||||
for (id child in [nodeController children]) {
|
for (id child in [nodeController children]) {
|
||||||
if ([child isKindOfClass:%c(ELMNodeController)]) {
|
if ([child isKindOfClass:%c(ELMNodeController)]) {
|
||||||
|
|
@ -1535,12 +1535,17 @@ static BOOL findCell(ASNodeController *nodeController, NSArray <NSString *> *ide
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
|
|
||||||
// Hide the Videos under the Video Player - @Dayanch96
|
// Hide the Videos under the Video Player - @Dayanch96 & @arichornlover
|
||||||
%group gNoRelatedWatchNexts
|
%group gNoRelatedWatchNexts
|
||||||
%hook YTWatchNextResultsViewController
|
%hook YTWatchNextResultsViewController
|
||||||
- (void)setVisibleSections:(NSInteger)arg1 {
|
- (void)setVisibleSections:(NSInteger)arg1 {
|
||||||
arg1 = 1;
|
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad && UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)) {
|
||||||
%orig(arg1);
|
// doesn't hide Videos under the Video Player if iPad is in Landscape mode to prevent conflicts
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
arg1 = 1;
|
||||||
|
%orig(arg1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
%end
|
%end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue