Skip to content

Commit

Permalink
3.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dayanch96 committed Mar 7, 2024
1 parent d2989b3 commit 1991a9d
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion YTLite.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@
@end

@interface YTSegmentableInlinePlayerBarView : UIView
@property (nonatomic, assign, readonly) CGFloat totalTime;
@property (nonatomic, assign, readwrite) BOOL enableSnapToChapter;
@end

Expand Down
31 changes: 17 additions & 14 deletions YTLite.x
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -1230,7 +1233,7 @@ BOOL isTabSelected = NO;
- (void)showPivotBar {
if (!ytlBool(@"shortsOnlyMode")) {
%orig;

isOverlayShown = YES;
}
}
Expand Down
2 changes: 2 additions & 0 deletions control
Original file line number Diff line number Diff line change
Expand Up @@ -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
Binary file added packages/com.dvntm.ytlite_3.0.1_iphoneos-arm.deb
Binary file not shown.
Binary file not shown.

0 comments on commit 1991a9d

Please sign in to comment.