mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-08 20:47:11 +03:00
Made highlight category work with hover text
This commit is contained in:
@@ -102,9 +102,10 @@ class PreviewBar {
|
|||||||
let currentSegmentLength = Infinity;
|
let currentSegmentLength = Infinity;
|
||||||
|
|
||||||
for (const seg of this.segments) {
|
for (const seg of this.segments) {
|
||||||
if (seg.segment[0] <= timeInSeconds && seg.segment[1] > timeInSeconds) {
|
|
||||||
const segmentLength = seg.segment[1] - seg.segment[0];
|
const segmentLength = seg.segment[1] - seg.segment[0];
|
||||||
|
const startTime = segmentLength !== 0 ? seg.segment[0] : Math.floor(seg.segment[0]);
|
||||||
|
const endTime = segmentLength !== 0 ? seg.segment[1] : Math.ceil(seg.segment[1]);
|
||||||
|
if (startTime <= timeInSeconds && endTime >= timeInSeconds) {
|
||||||
if (segmentLength < currentSegmentLength) {
|
if (segmentLength < currentSegmentLength) {
|
||||||
currentSegmentLength = segmentLength;
|
currentSegmentLength = segmentLength;
|
||||||
segment = seg;
|
segment = seg;
|
||||||
|
|||||||
Reference in New Issue
Block a user