mirror of
https://github.com/SoPat712/YTLitePlus.git
synced 2025-08-21 18:48:45 -04:00
Fixed #55 (Updated YTUnshorts from Poomsmart)
This commit is contained in:
@@ -348,18 +348,28 @@ static BOOL IsEnabled(NSString *key) {
|
|||||||
|
|
||||||
// YTUnShorts - https://github.com/PoomSmart/YTUnShorts
|
// YTUnShorts - https://github.com/PoomSmart/YTUnShorts
|
||||||
%hook YTIElementRenderer
|
%hook YTIElementRenderer
|
||||||
|
|
||||||
|
static NSData *cellDividerData = nil;
|
||||||
|
|
||||||
- (NSData *)elementData {
|
- (NSData *)elementData {
|
||||||
NSString *description = [self description];
|
NSString *description = [self description];
|
||||||
|
|
||||||
if (IsEnabled(@"UnShorts_enabled")) {
|
if (IsEnabled(@"UnShorts_enabled")) {
|
||||||
if ([description containsString:@"shorts_shelf.eml"] ||
|
if ([description containsString:@"cell_divider"]) {
|
||||||
[description containsString:@"#shorts"] ||
|
if (!cellDividerData) cellDividerData = %orig;
|
||||||
[description containsString:@"shorts_video_cell.eml"] ||
|
return cellDividerData;
|
||||||
[description containsString:@"6Shorts"]) {
|
|
||||||
if (![description containsString:@"history*"]) {
|
|
||||||
return nil;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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_"];
|
||||||
|
|
||||||
|
if (hasShorts || hasShortsInHistory) return cellDividerData;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hide Community Posts - @michael-winay & @arichorn
|
// Hide Community Posts - @michael-winay & @arichorn
|
||||||
if (IsEnabled(@"hideCommunityPosts_enabled")) {
|
if (IsEnabled(@"hideCommunityPosts_enabled")) {
|
||||||
if ([description containsString:@"post_base_wrapper.eml"]) {
|
if ([description containsString:@"post_base_wrapper.eml"]) {
|
||||||
|
Reference in New Issue
Block a user