2021-11-07 21:26:00 +01:00
|
|
|
import PreviewBar, { PreviewBarSegment } from "../src/js-components/previewBar";
|
|
|
|
|
|
|
|
describe("createChapterRenderGroups", () => {
|
|
|
|
let previewBar: PreviewBar;
|
|
|
|
beforeEach(() => {
|
2022-10-11 23:59:46 +02:00
|
|
|
previewBar = new PreviewBar(null, null, null, null, null, true);
|
2021-11-07 21:26:00 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
it("Two unrelated times", () => {
|
|
|
|
previewBar.videoDuration = 315;
|
|
|
|
const groups = previewBar.createChapterRenderGroups([{
|
|
|
|
segment: [2, 30],
|
|
|
|
category: "sponsor",
|
2022-09-16 08:02:48 +02:00
|
|
|
actionType: "skip",
|
2021-11-07 21:26:00 +01:00
|
|
|
unsubmitted: false,
|
|
|
|
showLarger: false,
|
|
|
|
description: ""
|
|
|
|
}, {
|
|
|
|
segment: [50, 80],
|
|
|
|
category: "sponsor",
|
2022-09-16 08:02:48 +02:00
|
|
|
actionType: "skip",
|
2021-11-07 21:26:00 +01:00
|
|
|
unsubmitted: false,
|
|
|
|
showLarger: false,
|
|
|
|
description: ""
|
|
|
|
}] as PreviewBarSegment[]);
|
|
|
|
|
|
|
|
expect(groups).toStrictEqual([{
|
|
|
|
segment: [0, 2],
|
2022-09-16 08:02:48 +02:00
|
|
|
originalDuration: 0,
|
|
|
|
actionType: null
|
2021-11-07 21:26:00 +01:00
|
|
|
}, {
|
|
|
|
segment: [2, 30],
|
2022-09-16 08:02:48 +02:00
|
|
|
originalDuration: 30 - 2,
|
|
|
|
actionType: "skip"
|
2021-11-07 21:26:00 +01:00
|
|
|
}, {
|
|
|
|
segment: [30, 50],
|
2022-09-16 08:02:48 +02:00
|
|
|
originalDuration: 0,
|
|
|
|
actionType: null
|
2021-11-07 21:26:00 +01:00
|
|
|
}, {
|
|
|
|
segment: [50, 80],
|
2022-09-16 08:02:48 +02:00
|
|
|
originalDuration: 80 - 50,
|
|
|
|
actionType: "skip"
|
2021-11-07 21:26:00 +01:00
|
|
|
}, {
|
|
|
|
segment: [80, 315],
|
2022-09-16 08:02:48 +02:00
|
|
|
originalDuration: 0,
|
|
|
|
actionType: null
|
2021-11-07 21:26:00 +01:00
|
|
|
}]);
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Small time in bigger time", () => {
|
|
|
|
previewBar.videoDuration = 315;
|
|
|
|
const groups = previewBar.createChapterRenderGroups([{
|
|
|
|
segment: [2.52, 30],
|
|
|
|
category: "sponsor",
|
2022-09-16 08:02:48 +02:00
|
|
|
actionType: "skip",
|
2021-11-07 21:26:00 +01:00
|
|
|
unsubmitted: false,
|
|
|
|
showLarger: false,
|
|
|
|
description: ""
|
|
|
|
}, {
|
|
|
|
segment: [20, 25],
|
|
|
|
category: "sponsor",
|
2022-09-16 08:02:48 +02:00
|
|
|
actionType: "skip",
|
2021-11-07 21:26:00 +01:00
|
|
|
unsubmitted: false,
|
|
|
|
showLarger: false,
|
|
|
|
description: ""
|
|
|
|
}] as PreviewBarSegment[]);
|
|
|
|
|
|
|
|
expect(groups).toStrictEqual([{
|
|
|
|
segment: [0, 2.52],
|
2022-09-16 08:02:48 +02:00
|
|
|
originalDuration: 0,
|
|
|
|
actionType: null
|
2021-11-07 21:26:00 +01:00
|
|
|
}, {
|
|
|
|
segment: [2.52, 20],
|
2022-09-16 08:02:48 +02:00
|
|
|
originalDuration: 30 - 2.52,
|
|
|
|
actionType: "skip"
|
2021-11-07 21:26:00 +01:00
|
|
|
}, {
|
|
|
|
segment: [20, 25],
|
2022-09-16 08:02:48 +02:00
|
|
|
originalDuration: 25 - 20,
|
|
|
|
actionType: "skip"
|
2021-11-07 21:26:00 +01:00
|
|
|
}, {
|
|
|
|
segment: [25, 30],
|
2022-09-16 08:02:48 +02:00
|
|
|
originalDuration: 30 - 2.52,
|
|
|
|
actionType: "skip"
|
2021-11-07 21:26:00 +01:00
|
|
|
}, {
|
|
|
|
segment: [30, 315],
|
2022-09-16 08:02:48 +02:00
|
|
|
originalDuration: 0,
|
|
|
|
actionType: null
|
2021-11-07 21:26:00 +01:00
|
|
|
}]);
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Same start time", () => {
|
|
|
|
previewBar.videoDuration = 315;
|
|
|
|
const groups = previewBar.createChapterRenderGroups([{
|
|
|
|
segment: [2.52, 30],
|
|
|
|
category: "sponsor",
|
2022-09-16 08:02:48 +02:00
|
|
|
actionType: "skip",
|
2021-11-07 21:26:00 +01:00
|
|
|
unsubmitted: false,
|
|
|
|
showLarger: false,
|
|
|
|
description: ""
|
|
|
|
}, {
|
|
|
|
segment: [2.52, 40],
|
|
|
|
category: "sponsor",
|
2022-09-16 08:02:48 +02:00
|
|
|
actionType: "skip",
|
2021-11-07 21:26:00 +01:00
|
|
|
unsubmitted: false,
|
|
|
|
showLarger: false,
|
|
|
|
description: ""
|
|
|
|
}] as PreviewBarSegment[]);
|
|
|
|
|
|
|
|
expect(groups).toStrictEqual([{
|
|
|
|
segment: [0, 2.52],
|
2022-09-16 08:02:48 +02:00
|
|
|
originalDuration: 0,
|
|
|
|
actionType: null
|
2021-11-07 21:26:00 +01:00
|
|
|
}, {
|
|
|
|
segment: [2.52, 30],
|
2022-09-16 08:02:48 +02:00
|
|
|
originalDuration: 30 - 2.52,
|
|
|
|
actionType: "skip"
|
2021-11-07 21:26:00 +01:00
|
|
|
}, {
|
|
|
|
segment: [30, 40],
|
2022-09-16 08:02:48 +02:00
|
|
|
originalDuration: 40 - 2.52,
|
|
|
|
actionType: "skip"
|
2021-11-07 21:26:00 +01:00
|
|
|
}, {
|
|
|
|
segment: [40, 315],
|
2022-09-16 08:02:48 +02:00
|
|
|
originalDuration: 0,
|
|
|
|
actionType: null
|
2021-11-07 21:26:00 +01:00
|
|
|
}]);
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Lots of overlapping segments", () => {
|
|
|
|
previewBar.videoDuration = 315.061;
|
|
|
|
const groups = previewBar.createChapterRenderGroups([
|
|
|
|
{
|
|
|
|
"category": "chapter",
|
2022-09-16 08:02:48 +02:00
|
|
|
"actionType": "chapter",
|
2021-11-07 21:26:00 +01:00
|
|
|
"segment": [
|
|
|
|
0,
|
|
|
|
49.977
|
|
|
|
],
|
|
|
|
"locked": 0,
|
|
|
|
"votes": 0,
|
|
|
|
"videoDuration": 315.061,
|
|
|
|
"userID": "b1919787a85cd422af07136a913830eda1364d32e8a9e12104cf5e3bad8f6f45",
|
|
|
|
"description": "Start of video"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"category": "sponsor",
|
2022-09-16 08:02:48 +02:00
|
|
|
"actionType": "skip",
|
2021-11-07 21:26:00 +01:00
|
|
|
"segment": [
|
|
|
|
2.926,
|
|
|
|
5
|
|
|
|
],
|
|
|
|
"locked": 1,
|
|
|
|
"votes": 2,
|
|
|
|
"videoDuration": 316,
|
|
|
|
"userID": "938444fccfdb7272fd871b7f98c27ea9e5e806681db421bb69452e6a42730c20",
|
|
|
|
"description": ""
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"category": "chapter",
|
2022-09-16 08:02:48 +02:00
|
|
|
"actionType": "chapter",
|
2021-11-07 21:26:00 +01:00
|
|
|
"segment": [
|
|
|
|
14.487,
|
|
|
|
37.133
|
|
|
|
],
|
|
|
|
"locked": 0,
|
|
|
|
"votes": 0,
|
|
|
|
"videoDuration": 315.061,
|
|
|
|
"userID": "b1919787a85cd422af07136a913830eda1364d32e8a9e12104cf5e3bad8f6f45",
|
|
|
|
"description": "Subset of start"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"category": "sponsor",
|
2022-09-16 08:02:48 +02:00
|
|
|
"actionType": "skip",
|
2021-11-07 21:26:00 +01:00
|
|
|
"segment": [
|
|
|
|
23.450537,
|
|
|
|
34.486084
|
|
|
|
],
|
|
|
|
"locked": 0,
|
|
|
|
"votes": -1,
|
|
|
|
"videoDuration": 315.061,
|
|
|
|
"userID": "938444fccfdb7272fd871b7f98c27ea9e5e806681db421bb69452e6a42730c20",
|
|
|
|
"description": ""
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"category": "interaction",
|
2022-09-16 08:02:48 +02:00
|
|
|
"actionType": "skip",
|
2021-11-07 21:26:00 +01:00
|
|
|
"segment": [
|
|
|
|
50.015343,
|
|
|
|
56.775314
|
|
|
|
],
|
|
|
|
"locked": 0,
|
|
|
|
"votes": 0,
|
|
|
|
"videoDuration": 315.061,
|
|
|
|
"userID": "b2a85e8cdfbf21dd504babbcaca7f751b55a5a2df8179c1a83a121d0f5d56c0e",
|
|
|
|
"description": ""
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"category": "sponsor",
|
2022-09-16 08:02:48 +02:00
|
|
|
"actionType": "skip",
|
2021-11-07 21:26:00 +01:00
|
|
|
"segment": [
|
|
|
|
62.51888,
|
|
|
|
74.33331
|
|
|
|
],
|
|
|
|
"locked": 0,
|
|
|
|
"votes": -1,
|
|
|
|
"videoDuration": 316,
|
|
|
|
"userID": "938444fccfdb7272fd871b7f98c27ea9e5e806681db421bb69452e6a42730c20",
|
|
|
|
"description": ""
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"category": "sponsor",
|
2022-09-16 08:02:48 +02:00
|
|
|
"actionType": "skip",
|
2021-11-07 21:26:00 +01:00
|
|
|
"segment": [
|
|
|
|
88.71328,
|
|
|
|
96.05933
|
|
|
|
],
|
|
|
|
"locked": 0,
|
|
|
|
"votes": 0,
|
|
|
|
"videoDuration": 315.061,
|
|
|
|
"userID": "6c08c092db2b7a31210717cc1f2652e7e97d032e03c82b029a27c81cead1f90c",
|
|
|
|
"description": ""
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"category": "sponsor",
|
2022-09-16 08:02:48 +02:00
|
|
|
"actionType": "skip",
|
2021-11-07 21:26:00 +01:00
|
|
|
"segment": [
|
|
|
|
101.50703,
|
|
|
|
115.088326
|
|
|
|
],
|
|
|
|
"votes": 0,
|
|
|
|
"videoDuration": 315.061,
|
|
|
|
"userID": "2db207ad4b7a535a548fab293f4567bf97373997e67aadb47df8f91b673f6e53",
|
|
|
|
"description": ""
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"category": "sponsor",
|
2022-09-16 08:02:48 +02:00
|
|
|
"actionType": "skip",
|
2021-11-07 21:26:00 +01:00
|
|
|
"segment": [
|
|
|
|
122.211845,
|
|
|
|
137.42178
|
|
|
|
],
|
|
|
|
"locked": 0,
|
|
|
|
"votes": 1,
|
|
|
|
"videoDuration": 0,
|
|
|
|
"userID": "0312cbfa514d9d2dfb737816dc45f52aba7c23f0a3f0911273a6993b2cb57fcc",
|
|
|
|
"description": ""
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"category": "sponsor",
|
2022-09-16 08:02:48 +02:00
|
|
|
"actionType": "skip",
|
2021-11-07 21:26:00 +01:00
|
|
|
"segment": [
|
|
|
|
144.08913,
|
|
|
|
160.14084
|
|
|
|
],
|
|
|
|
"locked": 0,
|
|
|
|
"votes": -1,
|
|
|
|
"videoDuration": 316,
|
|
|
|
"userID": "938444fccfdb7272fd871b7f98c27ea9e5e806681db421bb69452e6a42730c20",
|
|
|
|
"description": ""
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"category": "sponsor",
|
2022-09-16 08:02:48 +02:00
|
|
|
"actionType": "skip",
|
2021-11-07 21:26:00 +01:00
|
|
|
"segment": [
|
|
|
|
164.22084,
|
|
|
|
170.98082
|
|
|
|
],
|
|
|
|
"locked": 0,
|
|
|
|
"votes": 0,
|
|
|
|
"videoDuration": 315.061,
|
|
|
|
"userID": "845c4377060d5801f5324f8e1be1e8373bfd9addcf6c68fc5a3c038111b506a3",
|
|
|
|
"description": ""
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"category": "sponsor",
|
2022-09-16 08:02:48 +02:00
|
|
|
"actionType": "skip",
|
2021-11-07 21:26:00 +01:00
|
|
|
"segment": [
|
|
|
|
180.56674,
|
|
|
|
189.16516
|
|
|
|
],
|
|
|
|
"locked": 0,
|
|
|
|
"votes": -1,
|
|
|
|
"videoDuration": 315.061,
|
|
|
|
"userID": "7c6b015687db7800c05756a0fd226fd8d101f5a1e1bfb1e5d97c440331fd6cb7",
|
|
|
|
"description": ""
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"category": "sponsor",
|
2022-09-16 08:02:48 +02:00
|
|
|
"actionType": "skip",
|
2021-11-07 21:26:00 +01:00
|
|
|
"segment": [
|
|
|
|
204.10468,
|
|
|
|
211.87865
|
|
|
|
],
|
|
|
|
"locked": 0,
|
|
|
|
"votes": 0,
|
|
|
|
"videoDuration": 315.061,
|
|
|
|
"userID": "3472e8ee00b5da957377ae32d59ddd3095c2b634c2c0c970dfabfb81d143699f",
|
|
|
|
"description": ""
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"category": "sponsor",
|
2022-09-16 08:02:48 +02:00
|
|
|
"actionType": "skip",
|
2021-11-07 21:26:00 +01:00
|
|
|
"segment": [
|
|
|
|
214.92064,
|
|
|
|
222.0186
|
|
|
|
],
|
|
|
|
"locked": 0,
|
|
|
|
"votes": 0,
|
|
|
|
"videoDuration": 0,
|
|
|
|
"userID": "62a00dffb344d27de7adf8ea32801c2fc0580087dc8d282837923e4bda6a1745",
|
|
|
|
"description": ""
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"category": "sponsor",
|
2022-09-16 08:02:48 +02:00
|
|
|
"actionType": "skip",
|
2021-11-07 21:26:00 +01:00
|
|
|
"segment": [
|
|
|
|
233.0754,
|
|
|
|
244.56734
|
|
|
|
],
|
|
|
|
"locked": 0,
|
|
|
|
"votes": -1,
|
|
|
|
"videoDuration": 315,
|
|
|
|
"userID": "dcf7fb0a6c071d5a93273ebcbecaee566e0ff98181057a36ed855e9b92bf25ea",
|
|
|
|
"description": ""
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"category": "sponsor",
|
2022-09-16 08:02:48 +02:00
|
|
|
"actionType": "skip",
|
2021-11-07 21:26:00 +01:00
|
|
|
"segment": [
|
|
|
|
260.64053,
|
|
|
|
269.35938
|
|
|
|
],
|
|
|
|
"locked": 0,
|
|
|
|
"votes": 0,
|
|
|
|
"videoDuration": 315.061,
|
|
|
|
"userID": "e0238059ae4e711567af5b08a3afecfe45601c995b0ea2f37ca43f15fca4e298",
|
|
|
|
"description": ""
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"category": "sponsor",
|
2022-09-16 08:02:48 +02:00
|
|
|
"actionType": "skip",
|
2021-11-07 21:26:00 +01:00
|
|
|
"segment": [
|
|
|
|
288.686,
|
|
|
|
301.96
|
|
|
|
],
|
|
|
|
"locked": 0,
|
|
|
|
"votes": 0,
|
|
|
|
"videoDuration": 315.061,
|
|
|
|
"userID": "e0238059ae4e711567af5b08a3afecfe45601c995b0ea2f37ca43f15fca4e298",
|
|
|
|
"description": ""
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"category": "sponsor",
|
2022-09-16 08:02:48 +02:00
|
|
|
"actionType": "skip",
|
2021-11-07 21:26:00 +01:00
|
|
|
"segment": [
|
|
|
|
288.686,
|
|
|
|
295
|
|
|
|
],
|
|
|
|
"locked": 0,
|
|
|
|
"votes": 0,
|
|
|
|
"videoDuration": 315.061,
|
|
|
|
"userID": "e0238059ae4e711567af5b08a3afecfe45601c995b0ea2f37ca43f15fca4e298",
|
|
|
|
"description": ""
|
2022-06-22 19:02:04 +02:00
|
|
|
}] as unknown as PreviewBarSegment[]);
|
2021-11-07 21:26:00 +01:00
|
|
|
|
|
|
|
expect(groups).toStrictEqual([
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
0,
|
|
|
|
2.926
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 49.977,
|
|
|
|
"actionType": "chapter"
|
2021-11-07 21:26:00 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
2.926,
|
|
|
|
5
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 2.074,
|
|
|
|
"actionType": "skip"
|
2021-11-07 21:26:00 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
5,
|
|
|
|
14.487
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 49.977,
|
|
|
|
"actionType": "chapter"
|
2021-11-07 21:26:00 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
14.487,
|
|
|
|
23.450537
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 22.646,
|
|
|
|
"actionType": "chapter"
|
2021-11-07 21:26:00 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
23.450537,
|
|
|
|
34.486084
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 11.035546999999998,
|
|
|
|
"actionType": "skip"
|
2021-11-07 21:26:00 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
34.486084,
|
|
|
|
37.133
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 22.646,
|
|
|
|
"actionType": "chapter"
|
2021-11-07 21:26:00 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
37.133,
|
|
|
|
49.977
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 49.977,
|
|
|
|
"actionType": "chapter"
|
2021-11-07 21:26:00 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
49.977,
|
|
|
|
50.015343
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 0,
|
|
|
|
"actionType": null
|
2021-11-07 21:26:00 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
50.015343,
|
|
|
|
56.775314
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 6.759971,
|
|
|
|
"actionType": "skip"
|
2021-11-07 21:26:00 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
56.775314,
|
|
|
|
62.51888
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 0,
|
|
|
|
"actionType": null
|
2021-11-07 21:26:00 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
62.51888,
|
|
|
|
74.33331
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 11.814429999999994,
|
|
|
|
"actionType": "skip"
|
2021-11-07 21:26:00 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
74.33331,
|
|
|
|
88.71328
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 0,
|
|
|
|
"actionType": null
|
2021-11-07 21:26:00 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
88.71328,
|
|
|
|
96.05933
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 7.346050000000005,
|
|
|
|
"actionType": "skip"
|
2021-11-07 21:26:00 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
96.05933,
|
|
|
|
101.50703
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 0,
|
|
|
|
"actionType": null
|
2021-11-07 21:26:00 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
101.50703,
|
|
|
|
115.088326
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 13.581295999999995,
|
|
|
|
"actionType": "skip"
|
2021-11-07 21:26:00 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
115.088326,
|
|
|
|
122.211845
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 0,
|
|
|
|
"actionType": null
|
2021-11-07 21:26:00 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
122.211845,
|
|
|
|
137.42178
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 15.209935000000016,
|
|
|
|
"actionType": "skip"
|
2021-11-07 21:26:00 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
137.42178,
|
|
|
|
144.08913
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 0,
|
|
|
|
"actionType": null
|
2021-11-07 21:26:00 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
144.08913,
|
|
|
|
160.14084
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 16.051709999999986,
|
|
|
|
"actionType": "skip"
|
2021-11-07 21:26:00 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
160.14084,
|
|
|
|
164.22084
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 0,
|
|
|
|
"actionType": null
|
2021-11-07 21:26:00 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
164.22084,
|
|
|
|
170.98082
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 6.759979999999985,
|
|
|
|
"actionType": "skip"
|
2021-11-07 21:26:00 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
170.98082,
|
|
|
|
180.56674
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 0,
|
|
|
|
"actionType": null
|
2021-11-07 21:26:00 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
180.56674,
|
|
|
|
189.16516
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 8.598419999999976,
|
|
|
|
"actionType": "skip"
|
2021-11-07 21:26:00 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
189.16516,
|
|
|
|
204.10468
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 0,
|
|
|
|
"actionType": null
|
2021-11-07 21:26:00 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
204.10468,
|
|
|
|
211.87865
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 7.773969999999991,
|
|
|
|
"actionType": "skip"
|
2021-11-07 21:26:00 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
211.87865,
|
|
|
|
214.92064
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 0,
|
|
|
|
"actionType": null
|
2021-11-07 21:26:00 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
214.92064,
|
|
|
|
222.0186
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 7.0979600000000005,
|
|
|
|
"actionType": "skip"
|
2021-11-07 21:26:00 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
222.0186,
|
|
|
|
233.0754
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 0,
|
|
|
|
"actionType": null
|
2021-11-07 21:26:00 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
233.0754,
|
|
|
|
244.56734
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 11.49194,
|
|
|
|
"actionType": "skip"
|
2021-11-07 21:26:00 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
244.56734,
|
|
|
|
260.64053
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 0,
|
|
|
|
"actionType": null
|
2021-11-07 21:26:00 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
260.64053,
|
|
|
|
269.35938
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 8.718849999999975,
|
|
|
|
"actionType": "skip"
|
2021-11-07 21:26:00 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
269.35938,
|
|
|
|
288.686
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 0,
|
|
|
|
"actionType": null
|
2021-11-07 21:26:00 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
288.686,
|
|
|
|
295
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 6.314000000000021,
|
|
|
|
"actionType": "skip"
|
2021-11-07 21:26:00 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
295,
|
|
|
|
301.96
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 13.274000000000001,
|
|
|
|
"actionType": "skip"
|
2021-11-07 21:26:00 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
301.96,
|
|
|
|
315.061
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 0,
|
|
|
|
"actionType": null
|
2021-11-07 21:26:00 +01:00
|
|
|
}
|
|
|
|
]);
|
|
|
|
})
|
2022-06-22 19:02:04 +02:00
|
|
|
|
|
|
|
it("Multiple overlapping", () => {
|
|
|
|
previewBar.videoDuration = 3615.161;
|
|
|
|
const groups = previewBar.createChapterRenderGroups([{
|
|
|
|
"segment": [
|
|
|
|
160,
|
|
|
|
2797.323
|
|
|
|
],
|
|
|
|
"category": "chooseACategory",
|
2022-09-16 08:02:48 +02:00
|
|
|
"actionType": "skip",
|
2022-06-22 19:02:04 +02:00
|
|
|
"unsubmitted": true,
|
|
|
|
"showLarger": false,
|
|
|
|
},{
|
|
|
|
"segment": [
|
|
|
|
169,
|
|
|
|
3432.255
|
|
|
|
],
|
|
|
|
"category": "chooseACategory",
|
2022-09-16 08:02:48 +02:00
|
|
|
"actionType": "skip",
|
2022-06-22 19:02:04 +02:00
|
|
|
"unsubmitted": true,
|
|
|
|
"showLarger": false,
|
|
|
|
},{
|
|
|
|
"segment": [
|
|
|
|
169,
|
|
|
|
3412.413
|
|
|
|
],
|
|
|
|
"category": "chooseACategory",
|
2022-09-16 08:02:48 +02:00
|
|
|
"actionType": "skip",
|
2022-06-22 19:02:04 +02:00
|
|
|
"unsubmitted": true,
|
|
|
|
"showLarger": false,
|
|
|
|
},{
|
|
|
|
"segment": [
|
|
|
|
1594.92,
|
|
|
|
1674.286
|
|
|
|
],
|
|
|
|
"category": "sponsor",
|
2022-09-16 08:02:48 +02:00
|
|
|
"actionType": "skip",
|
2022-06-22 19:02:04 +02:00
|
|
|
"unsubmitted": false,
|
|
|
|
"showLarger": false,
|
|
|
|
}
|
|
|
|
] as unknown as PreviewBarSegment[]);
|
|
|
|
|
|
|
|
expect(groups).toStrictEqual([
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
0,
|
|
|
|
160
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 0,
|
|
|
|
"actionType": null
|
2022-06-22 19:02:04 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
160,
|
|
|
|
169
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 2637.323,
|
|
|
|
"actionType": "skip"
|
2022-06-22 19:02:04 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
169,
|
|
|
|
1594.92
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 3243.413,
|
|
|
|
"actionType": "skip"
|
2022-06-22 19:02:04 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
1594.92,
|
|
|
|
1674.286
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 79.36599999999999,
|
|
|
|
"actionType": "skip"
|
2022-06-22 19:02:04 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
1674.286,
|
|
|
|
3412.413
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 3243.413,
|
|
|
|
"actionType": "skip"
|
2022-06-22 19:02:04 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
3412.413,
|
|
|
|
3432.255
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 3263.255,
|
|
|
|
"actionType": "skip"
|
2022-06-22 19:02:04 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"segment": [
|
|
|
|
3432.255,
|
|
|
|
3615.161
|
|
|
|
],
|
2022-09-16 08:02:48 +02:00
|
|
|
"originalDuration": 0,
|
|
|
|
"actionType": null
|
2022-06-22 19:02:04 +02:00
|
|
|
}
|
|
|
|
]);
|
|
|
|
});
|
2021-11-07 21:26:00 +01:00
|
|
|
})
|