Option Improvements

Improved 2 Options
- Hide Shorts Cells
- Hide Download Button under Player
This commit is contained in:
arichornlover 2023-10-19 01:30:46 -05:00 committed by GitHub
parent ce82c117db
commit 43b542d697
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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