1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Update getMarkerInfo syntax as suggested

This commit is contained in:
Viperinius 2022-10-01 16:09:25 +02:00
parent 33fe2c51d6
commit 9aea7e3927

View file

@ -1580,20 +1580,14 @@ import { setBackdropTransparency, TRANSPARENCY_LEVEL } from '../../../components
const item = currentItem;
// use markers based on chapters
if (item && item.Chapters && item.Chapters.length) {
const runtimeDuration = item.RunTimeTicks;
for (let i = 0, length = item.Chapters.length; i < length; i++) {
const currentChapter = item.Chapters[i];
const fraction = currentChapter.StartPositionTicks / runtimeDuration;
if (item?.Chapters?.length) {
item.Chapters.forEach(currentChapter => {
markers.push({
className: 'chapterMarker',
name: currentChapter.Name,
progress: fraction
progress: currentChapter.StartPositionTicks / item.RunTimeTicks
});
});
}
}
return markers;