From 462dfee20936c4644c65487daac67dca3e9e5190 Mon Sep 17 00:00:00 2001 From: Bryce Hackel <34104885+bhackel@users.noreply.github.com> Date: Sun, 7 Jul 2024 00:30:37 -0700 Subject: [PATCH] Add always remaining time/disable toggle time --- Source/Settings.xm | 2 ++ YTLitePlus.xm | 32 +++++++++++++++++++ .../ar.lproj/Localizable.strings | 6 ++++ .../de.lproj/Localizable.strings | 6 ++++ .../en.lproj/Localizable.strings | 6 ++++ .../es.lproj/Localizable.strings | 6 ++++ .../fr.lproj/Localizable.strings | 6 ++++ .../ja.lproj/Localizable.strings | 6 ++++ .../pt.lproj/Localizable.strings | 6 ++++ .../ro.lproj/Localizable.strings | 6 ++++ .../ru.lproj/Localizable.strings | 6 ++++ .../template.lproj/Localizable.strings | 6 ++++ .../tr.lproj/Localizable.strings | 6 ++++ .../vi.lproj/Localizable.strings | 6 ++++ 14 files changed, 106 insertions(+) diff --git a/Source/Settings.xm b/Source/Settings.xm index 978b157..bfa2aff 100644 --- a/Source/Settings.xm +++ b/Source/Settings.xm @@ -120,6 +120,8 @@ static const NSInteger YTLiteSection = 789; BASIC_SWITCH(LOC(@"SEEK_ANYWHERE"), LOC(@"SEEK_ANYWHERE_DESC"), @"seekAnywhere_enabled"), BASIC_SWITCH(LOC(@"ENABLE_TAP_TO_SEEK"), LOC(@"ENABLE_TAP_TO_SEEK_DESC"), @"YTTapToSeek_enabled"), BASIC_SWITCH(LOC(@"DISABLE_PULL_TO_FULLSCREEN_GESTURE"), LOC(@"DISABLE_PULL_TO_FULLSCREEN_GESTURE_DESC"), @"disablePullToFull_enabled"), + BASIC_SWITCH(LOC(@"ALWAYS_USE_REMAINING_TIME"), LOC(@"ALWAYS_USE_REMAINING_TIME_DESC"), @"alwaysShowRemainingTime_enabled"), + BASIC_SWITCH(LOC(@"DISABLE_TOGGLE_TIME_REMAINING"), LOC(@"DISABLE_TOGGLE_TIME_REMAINING_DESC"), @"disableRemainingTime_enabled"), ]; YTSettingsPickerViewController *picker = [[%c(YTSettingsPickerViewController) alloc] initWithNavTitle:LOC(@"VIDEO_CONTROLS_OVERLAY_OPTIONS") pickerSectionTitle:nil rows:rows selectedItemIndex:NSNotFound parentResponder:[self parentResponder]]; [settingsViewController pushViewController:picker]; diff --git a/YTLitePlus.xm b/YTLitePlus.xm index 0c662d7..4b5939b 100644 --- a/YTLitePlus.xm +++ b/YTLitePlus.xm @@ -467,6 +467,38 @@ BOOL isTabSelected = NO; %end %end +// Always use remaining time in the video player - @bhackel +%hook YTPlayerBarController +// When a new video is played, enable time remaining flag +- (void)setActiveSingleVideo:(id)arg1 { + %orig; + if (IS_ENABLED(@"alwaysShowRemainingTime_enabled")) { + // Get the player bar view + YTInlinePlayerBarContainerView *playerBar = self.playerBar; + if (playerBar) { + // Enable the time remaining flag + playerBar.shouldDisplayTimeRemaining = YES; + } + } +} +%end + +// Disable toggle time remaining - @bhackel +%hook YTInlinePlayerBarContainerView +- (void)setShouldDisplayTimeRemaining:(BOOL)arg1 { + if (IS_ENABLED(@"disableRemainingTime_enabled")) { + // Set true if alwaysShowRemainingTime + if (IS_ENABLED(@"alwaysShowRemainingTime_enabled")) { + %orig(YES); + } else { + %orig(NO); + } + return; + } + %orig; +} +%end + // BigYTMiniPlayer: https://github.com/Galactic-Dev/BigYTMiniPlayer %group Main %hook YTWatchMiniBarView diff --git a/lang/YTLitePlus.bundle/ar.lproj/Localizable.strings b/lang/YTLitePlus.bundle/ar.lproj/Localizable.strings index 8e179fa..62861c8 100644 --- a/lang/YTLitePlus.bundle/ar.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/ar.lproj/Localizable.strings @@ -29,6 +29,12 @@ "DISABLE_PULL_TO_FULLSCREEN_GESTURE" = "Disable pull-to-fullscreen gesture"; "DISABLE_PULL_TO_FULLSCREEN_GESTURE_DESC" = "Disable the drag gesture to enter vertical fullscreen. Only applies to landscape videos."; +"ALWAYS_USE_REMAINING_TIME" = "Always use remaining time"; +"ALWAYS_USE_REMAINING_TIME_DESC" = "Change the default to show time remaining in the player bar."; + +"DISABLE_TOGGLE_TIME_REMAINING" = "Disable toggle time remaining"; +"DISABLE_TOGGLE_TIME_REMAINING_DESC" = "Disables changing time elapsed to time remaining. Use with other setting to always show remaining time."; + // App settings overlay options "APP_SETTINGS_OVERLAY_OPTIONS" = "App Settings Overlay Options"; diff --git a/lang/YTLitePlus.bundle/de.lproj/Localizable.strings b/lang/YTLitePlus.bundle/de.lproj/Localizable.strings index 758d448..50dc47e 100644 --- a/lang/YTLitePlus.bundle/de.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/de.lproj/Localizable.strings @@ -29,6 +29,12 @@ "DISABLE_PULL_TO_FULLSCREEN_GESTURE" = "Disable pull-to-fullscreen gesture"; "DISABLE_PULL_TO_FULLSCREEN_GESTURE_DESC" = "Disable the drag gesture to enter vertical fullscreen. Only applies to landscape videos."; +"ALWAYS_USE_REMAINING_TIME" = "Always use remaining time"; +"ALWAYS_USE_REMAINING_TIME_DESC" = "Change the default to show time remaining in the player bar."; + +"DISABLE_TOGGLE_TIME_REMAINING" = "Disable toggle time remaining"; +"DISABLE_TOGGLE_TIME_REMAINING_DESC" = "Disables changing time elapsed to time remaining. Use with other setting to always show remaining time."; + // App settings overlay options "APP_SETTINGS_OVERLAY_OPTIONS" = "Overlay-Optionen für App-Einstellungen"; diff --git a/lang/YTLitePlus.bundle/en.lproj/Localizable.strings b/lang/YTLitePlus.bundle/en.lproj/Localizable.strings index 64335b8..27debf2 100644 --- a/lang/YTLitePlus.bundle/en.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/en.lproj/Localizable.strings @@ -29,6 +29,12 @@ "DISABLE_PULL_TO_FULLSCREEN_GESTURE" = "Disable pull-to-fullscreen gesture"; "DISABLE_PULL_TO_FULLSCREEN_GESTURE_DESC" = "Disable the drag gesture to enter vertical fullscreen. Only applies to landscape videos."; +"ALWAYS_USE_REMAINING_TIME" = "Always use remaining time"; +"ALWAYS_USE_REMAINING_TIME_DESC" = "Change the default to show time remaining in the player bar."; + +"DISABLE_TOGGLE_TIME_REMAINING" = "Disable toggle time remaining"; +"DISABLE_TOGGLE_TIME_REMAINING_DESC" = "Disables changing time elapsed to time remaining. Use with other setting to always show remaining time."; + // App settings overlay options "APP_SETTINGS_OVERLAY_OPTIONS" = "App Settings Overlay Options"; diff --git a/lang/YTLitePlus.bundle/es.lproj/Localizable.strings b/lang/YTLitePlus.bundle/es.lproj/Localizable.strings index 1a34143..948161e 100644 --- a/lang/YTLitePlus.bundle/es.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/es.lproj/Localizable.strings @@ -29,6 +29,12 @@ "DISABLE_PULL_TO_FULLSCREEN_GESTURE" = "Disable pull-to-fullscreen gesture"; "DISABLE_PULL_TO_FULLSCREEN_GESTURE_DESC" = "Disable the drag gesture to enter vertical fullscreen. Only applies to landscape videos."; +"ALWAYS_USE_REMAINING_TIME" = "Always use remaining time"; +"ALWAYS_USE_REMAINING_TIME_DESC" = "Change the default to show time remaining in the player bar."; + +"DISABLE_TOGGLE_TIME_REMAINING" = "Disable toggle time remaining"; +"DISABLE_TOGGLE_TIME_REMAINING_DESC" = "Disables changing time elapsed to time remaining. Use with other setting to always show remaining time."; + // App settings overlay options "APP_SETTINGS_OVERLAY_OPTIONS" = "Opciones de superposición de los ajustes de la aplicación"; diff --git a/lang/YTLitePlus.bundle/fr.lproj/Localizable.strings b/lang/YTLitePlus.bundle/fr.lproj/Localizable.strings index 41d51a5..a593b66 100644 --- a/lang/YTLitePlus.bundle/fr.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/fr.lproj/Localizable.strings @@ -29,6 +29,12 @@ "DISABLE_PULL_TO_FULLSCREEN_GESTURE" = "Disable pull-to-fullscreen gesture"; "DISABLE_PULL_TO_FULLSCREEN_GESTURE_DESC" = "Disable the drag gesture to enter vertical fullscreen. Only applies to landscape videos."; +"ALWAYS_USE_REMAINING_TIME" = "Always use remaining time"; +"ALWAYS_USE_REMAINING_TIME_DESC" = "Change the default to show time remaining in the player bar."; + +"DISABLE_TOGGLE_TIME_REMAINING" = "Disable toggle time remaining"; +"DISABLE_TOGGLE_TIME_REMAINING_DESC" = "Disables changing time elapsed to time remaining. Use with other setting to always show remaining time."; + // App settings overlay options "APP_SETTINGS_OVERLAY_OPTIONS" = "Paramètres des options d'overlay de l'application"; diff --git a/lang/YTLitePlus.bundle/ja.lproj/Localizable.strings b/lang/YTLitePlus.bundle/ja.lproj/Localizable.strings index 8e304c5..fec6f1e 100644 --- a/lang/YTLitePlus.bundle/ja.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/ja.lproj/Localizable.strings @@ -29,6 +29,12 @@ "DISABLE_PULL_TO_FULLSCREEN_GESTURE" = "Disable pull-to-fullscreen gesture"; "DISABLE_PULL_TO_FULLSCREEN_GESTURE_DESC" = "Disable the drag gesture to enter vertical fullscreen. Only applies to landscape videos."; +"ALWAYS_USE_REMAINING_TIME" = "Always use remaining time"; +"ALWAYS_USE_REMAINING_TIME_DESC" = "Change the default to show time remaining in the player bar."; + +"DISABLE_TOGGLE_TIME_REMAINING" = "Disable toggle time remaining"; +"DISABLE_TOGGLE_TIME_REMAINING_DESC" = "Disables changing time elapsed to time remaining. Use with other setting to always show remaining time."; + // App settings overlay options "APP_SETTINGS_OVERLAY_OPTIONS" = "アプリの設定オーバーレイの設定"; diff --git a/lang/YTLitePlus.bundle/pt.lproj/Localizable.strings b/lang/YTLitePlus.bundle/pt.lproj/Localizable.strings index 7f2d8e5..bd92aee 100644 --- a/lang/YTLitePlus.bundle/pt.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/pt.lproj/Localizable.strings @@ -29,6 +29,12 @@ "DISABLE_PULL_TO_FULLSCREEN_GESTURE" = "Disable pull-to-fullscreen gesture"; "DISABLE_PULL_TO_FULLSCREEN_GESTURE_DESC" = "Disable the drag gesture to enter vertical fullscreen. Only applies to landscape videos."; +"ALWAYS_USE_REMAINING_TIME" = "Always use remaining time"; +"ALWAYS_USE_REMAINING_TIME_DESC" = "Change the default to show time remaining in the player bar."; + +"DISABLE_TOGGLE_TIME_REMAINING" = "Disable toggle time remaining"; +"DISABLE_TOGGLE_TIME_REMAINING_DESC" = "Disables changing time elapsed to time remaining. Use with other setting to always show remaining time."; + // App settings overlay options "APP_SETTINGS_OVERLAY_OPTIONS" = "App Settings Overlay Options"; diff --git a/lang/YTLitePlus.bundle/ro.lproj/Localizable.strings b/lang/YTLitePlus.bundle/ro.lproj/Localizable.strings index b3dbe58..35e28b5 100644 --- a/lang/YTLitePlus.bundle/ro.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/ro.lproj/Localizable.strings @@ -29,6 +29,12 @@ "DISABLE_PULL_TO_FULLSCREEN_GESTURE" = "Disable pull-to-fullscreen gesture"; "DISABLE_PULL_TO_FULLSCREEN_GESTURE_DESC" = "Disable the drag gesture to enter vertical fullscreen. Only applies to landscape videos."; +"ALWAYS_USE_REMAINING_TIME" = "Always use remaining time"; +"ALWAYS_USE_REMAINING_TIME_DESC" = "Change the default to show time remaining in the player bar."; + +"DISABLE_TOGGLE_TIME_REMAINING" = "Disable toggle time remaining"; +"DISABLE_TOGGLE_TIME_REMAINING_DESC" = "Disables changing time elapsed to time remaining. Use with other setting to always show remaining time."; + // App settings overlay options "APP_SETTINGS_OVERLAY_OPTIONS" = "Opțiuni Overlay Setări Aplicație"; diff --git a/lang/YTLitePlus.bundle/ru.lproj/Localizable.strings b/lang/YTLitePlus.bundle/ru.lproj/Localizable.strings index 123890b..0b09b85 100644 --- a/lang/YTLitePlus.bundle/ru.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/ru.lproj/Localizable.strings @@ -29,6 +29,12 @@ "DISABLE_PULL_TO_FULLSCREEN_GESTURE" = "Disable pull-to-fullscreen gesture"; "DISABLE_PULL_TO_FULLSCREEN_GESTURE_DESC" = "Disable the drag gesture to enter vertical fullscreen. Only applies to landscape videos."; +"ALWAYS_USE_REMAINING_TIME" = "Always use remaining time"; +"ALWAYS_USE_REMAINING_TIME_DESC" = "Change the default to show time remaining in the player bar."; + +"DISABLE_TOGGLE_TIME_REMAINING" = "Disable toggle time remaining"; +"DISABLE_TOGGLE_TIME_REMAINING_DESC" = "Disables changing time elapsed to time remaining. Use with other setting to always show remaining time."; + // App settings overlay options "APP_SETTINGS_OVERLAY_OPTIONS" = "App Settings Overlay Options"; diff --git a/lang/YTLitePlus.bundle/template.lproj/Localizable.strings b/lang/YTLitePlus.bundle/template.lproj/Localizable.strings index 14255f3..1c15a12 100644 --- a/lang/YTLitePlus.bundle/template.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/template.lproj/Localizable.strings @@ -44,6 +44,12 @@ https://github.com/PoomSmart/Return-YouTube-Dislikes/tree/main/layout/Library/Ap "DISABLE_PULL_TO_FULLSCREEN_GESTURE" = "Disable pull-to-fullscreen gesture"; "DISABLE_PULL_TO_FULLSCREEN_GESTURE_DESC" = "Disable the drag gesture to enter vertical fullscreen. Only applies to landscape videos."; +"ALWAYS_USE_REMAINING_TIME" = "Always use remaining time"; +"ALWAYS_USE_REMAINING_TIME_DESC" = "Change the default to show time remaining in the player bar."; + +"DISABLE_TOGGLE_TIME_REMAINING" = "Disable toggle time remaining"; +"DISABLE_TOGGLE_TIME_REMAINING_DESC" = "Disables changing time elapsed to time remaining. Use with other setting to always show remaining time."; + // App settings overlay options "APP_SETTINGS_OVERLAY_OPTIONS" = "App Settings Overlay Options"; diff --git a/lang/YTLitePlus.bundle/tr.lproj/Localizable.strings b/lang/YTLitePlus.bundle/tr.lproj/Localizable.strings index 41a7379..a661bd1 100644 --- a/lang/YTLitePlus.bundle/tr.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/tr.lproj/Localizable.strings @@ -29,6 +29,12 @@ "DISABLE_PULL_TO_FULLSCREEN_GESTURE" = "Disable pull-to-fullscreen gesture"; "DISABLE_PULL_TO_FULLSCREEN_GESTURE_DESC" = "Disable the drag gesture to enter vertical fullscreen. Only applies to landscape videos."; +"ALWAYS_USE_REMAINING_TIME" = "Always use remaining time"; +"ALWAYS_USE_REMAINING_TIME_DESC" = "Change the default to show time remaining in the player bar."; + +"DISABLE_TOGGLE_TIME_REMAINING" = "Disable toggle time remaining"; +"DISABLE_TOGGLE_TIME_REMAINING_DESC" = "Disables changing time elapsed to time remaining. Use with other setting to always show remaining time."; + // App settings overlay options "APP_SETTINGS_OVERLAY_OPTIONS" = "App Settings Overlay Options"; diff --git a/lang/YTLitePlus.bundle/vi.lproj/Localizable.strings b/lang/YTLitePlus.bundle/vi.lproj/Localizable.strings index 6d9a566..0e68014 100644 --- a/lang/YTLitePlus.bundle/vi.lproj/Localizable.strings +++ b/lang/YTLitePlus.bundle/vi.lproj/Localizable.strings @@ -38,6 +38,12 @@ "DISABLE_PULL_TO_FULLSCREEN_GESTURE" = "Disable pull-to-fullscreen gesture"; "DISABLE_PULL_TO_FULLSCREEN_GESTURE_DESC" = "Disable the drag gesture to enter vertical fullscreen. Only applies to landscape videos."; +"ALWAYS_USE_REMAINING_TIME" = "Always use remaining time"; +"ALWAYS_USE_REMAINING_TIME_DESC" = "Change the default to show time remaining in the player bar."; + +"DISABLE_TOGGLE_TIME_REMAINING" = "Disable toggle time remaining"; +"DISABLE_TOGGLE_TIME_REMAINING_DESC" = "Disables changing time elapsed to time remaining. Use with other setting to always show remaining time."; + // Shorts controls overlay options "SHORTS_CONTROLS_OVERLAY_OPTIONS" = "Tùy chọn lớp phủ điều khiển quần short";