add toggle to hide play next in queue

This commit is contained in:
level3tjg 2023-09-05 11:35:22 -04:00
parent 8f1d16746f
commit 687d0e7d10
4 changed files with 20 additions and 1 deletions

View file

@ -365,6 +365,16 @@ extern NSBundle *uYouPlusBundle();
}
settingItemId:0],
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"HIDE_PLAY_NEXT_IN_QUEUE")
titleDescription:LOC(@"HIDE_PLAY_NEXT_IN_QUEUE_DESC")
accessibilityIdentifier:nil
switchOn:IsEnabled(@"hidePlayNextInQueue_enabled")
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hidePlayNextInQueue_enabled"];
return YES;
}
settingItemId:0],
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"IPHONE_LAYOUT")
titleDescription:LOC(@"IPHONE_LAYOUT_DESC")
accessibilityIdentifier:nil

View file

@ -130,6 +130,9 @@
"HIDE_CHIP_BAR" = "Hide the Upper bar";
"HIDE_CHIP_BAR_DESC" = "Hide Upper bar in the Home feeds (Trends, Music, Gaming...) and Subscription feeds (All videos, Continue watching...).";
"HIDE_PLAY_NEXT_IN_QUEUE" = "Hide \"Play next in queue\"";
"HIDE_PLAY_NEXT_IN_QUEUE_DESC" = "Hide the premium \"Play next in queue\" option in video context menus";
"NEW_MINIPLAYER_STYLE" = "New mini player bar style (BigYTMiniPlayer)";
"NEW_MINIPLAYER_STYLE_DESC" = "App restart is required.";

View file

@ -145,6 +145,9 @@ https://github.com/PoomSmart/Return-YouTube-Dislikes/tree/main/layout/Library/Ap
"HIDE_CHIP_BAR" = "Hide the Upper bar";
"HIDE_CHIP_BAR_DESC" = "Hide Upper bar in the Home feeds (Trends, Music, Gaming...) and Subscription feeds (All videos, Continue watching...).";
"HIDE_PLAY_NEXT_IN_QUEUE" = "Hide \"Play next in queue\"";
"HIDE_PLAY_NEXT_IN_QUEUE_DESC" = "Hide the premium \"Play next in queue\" option in video context menus";
"NEW_MINIPLAYER_STYLE" = "New mini player bar style (BigYTMiniPlayer)";
"NEW_MINIPLAYER_STYLE_DESC" = "App restart is required.";

View file

@ -155,7 +155,7 @@ static BOOL oldDarkTheme() {
// Remove “Play next in queue” from the menu (@PoomSmart) - qnblackcat/uYouPlus#1138
%hook YTMenuItemVisibilityHandler
- (BOOL)shouldShowServiceItemRenderer:(YTIMenuConditionalServiceItemRenderer *)renderer {
return renderer.icon.iconType == 251 ? NO : %orig;
return IsEnabled(@"hidePlayNextInQueue_enabled") && renderer.icon.iconType == 251 ? NO : %orig;
}
%end
@ -1027,6 +1027,9 @@ UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha:
// Change the default value of some options
NSArray *allKeys = [[[NSUserDefaults standardUserDefaults] dictionaryRepresentation] allKeys];
if (![allKeys containsObject:@"hidePlayNextInQueue_enabled"]) {
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"hidePlayNextInQueue_enabled"];
}
if (![allKeys containsObject:@"relatedVideosAtTheEndOfYTVideos"]) {
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"relatedVideosAtTheEndOfYTVideos"];
}