fix(YouTube - SponsorBlock): Fix skip highlight button showing when set to 'show in seekbar'

This commit is contained in:
LisoUseInAIKyrios 2023-07-27 01:24:13 +04:00
parent 8ef81235d7
commit ea7bc57375

View File

@ -50,7 +50,7 @@ public class SegmentPlaybackController {
private static SponsorSegment[] segments; private static SponsorSegment[] segments;
/** /**
* Highlight segment, if one exists. * Highlight segment, if one exists and the skip behavior is not set to {@link CategoryBehaviour#SHOW_IN_SEEKBAR}.
*/ */
@Nullable @Nullable
private static SponsorSegment highlightSegment; private static SponsorSegment highlightSegment;
@ -112,10 +112,13 @@ public class SegmentPlaybackController {
segments = videoSegments; segments = videoSegments;
calculateTimeWithoutSegments(); calculateTimeWithoutSegments();
for (SponsorSegment segment : videoSegments) { if (SegmentCategory.HIGHLIGHT.behaviour == CategoryBehaviour.SKIP_AUTOMATICALLY
if (segment.category == SegmentCategory.HIGHLIGHT) { || SegmentCategory.HIGHLIGHT.behaviour == CategoryBehaviour.MANUAL_SKIP) {
highlightSegment = segment; for (SponsorSegment segment : videoSegments) {
return; if (segment.category == SegmentCategory.HIGHLIGHT) {
highlightSegment = segment;
return;
}
} }
} }
highlightSegment = null; highlightSegment = null;