diff --git a/Makefile b/Makefile index b4e1130..0a03e29 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ endif DEBUG=0 FINALPACKAGE=1 ARCHS = arm64 -PACKAGE_VERSION = 3.0 +PACKAGE_VERSION = 3.0.1 TARGET := iphone:clang:latest:13.0 include $(THEOS)/makefiles/common.mk diff --git a/YTLite.h b/YTLite.h index 85f0f17..e79639f 100644 --- a/YTLite.h +++ b/YTLite.h @@ -213,7 +213,6 @@ @end @interface YTSegmentableInlinePlayerBarView : UIView -@property (nonatomic, assign, readonly) CGFloat totalTime; @property (nonatomic, assign, readwrite) BOOL enableSnapToChapter; @end diff --git a/YTLite.x b/YTLite.x index 1f7bdb9..81746c5 100644 --- a/YTLite.x +++ b/YTLite.x @@ -411,6 +411,20 @@ void addEndTime(YTPlayerViewController *self, YTSingleVideoController *video, YT } } +void autoSkipShorts(YTPlayerViewController *self, YTSingleVideoController *video, YTSingleVideoTime *time) { + if (!ytlBool(@"autoSkipShorts")) return; + + if (floor(time.time) >= floor(video.totalMediaTime)) { + if ([self.parentViewController isKindOfClass:%c(YTShortsPlayerViewController)]) { + YTShortsPlayerViewController *shortsVC = (YTShortsPlayerViewController *)self.parentViewController; + + if ([shortsVC respondsToSelector:@selector(reelContentViewRequestsAdvanceToNextVideo:)]) { + [shortsVC performSelector:@selector(reelContentViewRequestsAdvanceToNextVideo:)]; + } + } + } +} + %hook YTPlayerViewController - (void)loadWithPlayerTransition:(id)arg1 playbackConfig:(id)arg2 { %orig; @@ -520,12 +534,14 @@ void addEndTime(YTPlayerViewController *self, YTSingleVideoController *video, YT %orig; addEndTime(self, video, time); + autoSkipShorts(self, video, time); } - (void)potentiallyMutatedSingleVideo:(YTSingleVideoController *)video currentVideoTimeDidChange:(YTSingleVideoTime *)time { %orig; addEndTime(self, video, time); + autoSkipShorts(self, video, time); } %end @@ -844,19 +860,6 @@ static BOOL isOverlayShown = YES; } %end -%hook YTSegmentableInlinePlayerBarView -- (void)setScrubberTime:(CGFloat)time { - %orig; - - if (ytlBool(@"autoSkipShorts") && round(time) == round(self.totalTime)) { - UIWindow *mainWindow = [UIApplication sharedApplication].windows.firstObject; - YTAppViewController *appVC = (YTAppViewController *)mainWindow.rootViewController; - - [appVC.pivotBarViewController.scrubberDelegate performSelector:@selector(reelContentViewRequestsAdvanceToNextVideo:)]; - } -} -%end - static void downloadImageFromURL(UIResponder *responder, NSURL *URL, BOOL download) { NSString *URLString = URL.absoluteString; @@ -1230,7 +1233,7 @@ BOOL isTabSelected = NO; - (void)showPivotBar { if (!ytlBool(@"shortsOnlyMode")) { %orig; - + isOverlayShown = YES; } } diff --git a/control b/control index bcca9d9..c6515aa 100644 --- a/control +++ b/control @@ -7,3 +7,5 @@ Description: Lightweight YouTube Enhancer Maintainer: dvntm Author: dvntm Section: Tweaks +Icon: https://raw.githubusercontent.com/dayanch96/icons/main/ytlite.png +SileoDepiction: https://raw.githubusercontent.com/dayanch96/icons/main/ytlite.json diff --git a/packages/com.dvntm.ytlite_3.0.1_iphoneos-arm.deb b/packages/com.dvntm.ytlite_3.0.1_iphoneos-arm.deb new file mode 100644 index 0000000..775f44b Binary files /dev/null and b/packages/com.dvntm.ytlite_3.0.1_iphoneos-arm.deb differ diff --git a/packages/com.dvntm.ytlite_3.0.1_iphoneos-arm64.deb b/packages/com.dvntm.ytlite_3.0.1_iphoneos-arm64.deb new file mode 100644 index 0000000..47a8c42 Binary files /dev/null and b/packages/com.dvntm.ytlite_3.0.1_iphoneos-arm64.deb differ