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,12 +112,15 @@ public class SegmentPlaybackController {
segments = videoSegments; segments = videoSegments;
calculateTimeWithoutSegments(); calculateTimeWithoutSegments();
if (SegmentCategory.HIGHLIGHT.behaviour == CategoryBehaviour.SKIP_AUTOMATICALLY
|| SegmentCategory.HIGHLIGHT.behaviour == CategoryBehaviour.MANUAL_SKIP) {
for (SponsorSegment segment : videoSegments) { for (SponsorSegment segment : videoSegments) {
if (segment.category == SegmentCategory.HIGHLIGHT) { if (segment.category == SegmentCategory.HIGHLIGHT) {
highlightSegment = segment; highlightSegment = segment;
return; return;
} }
} }
}
highlightSegment = null; highlightSegment = null;
} }