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:
parent
33fe2c51d6
commit
9aea7e3927
1 changed files with 4 additions and 10 deletions
|
@ -1580,20 +1580,14 @@ import { setBackdropTransparency, TRANSPARENCY_LEVEL } from '../../../components
|
||||||
const item = currentItem;
|
const item = currentItem;
|
||||||
|
|
||||||
// use markers based on chapters
|
// use markers based on chapters
|
||||||
if (item && item.Chapters && item.Chapters.length) {
|
if (item?.Chapters?.length) {
|
||||||
const runtimeDuration = item.RunTimeTicks;
|
item.Chapters.forEach(currentChapter => {
|
||||||
|
|
||||||
for (let i = 0, length = item.Chapters.length; i < length; i++) {
|
|
||||||
const currentChapter = item.Chapters[i];
|
|
||||||
|
|
||||||
const fraction = currentChapter.StartPositionTicks / runtimeDuration;
|
|
||||||
|
|
||||||
markers.push({
|
markers.push({
|
||||||
className: 'chapterMarker',
|
className: 'chapterMarker',
|
||||||
name: currentChapter.Name,
|
name: currentChapter.Name,
|
||||||
progress: fraction
|
progress: currentChapter.StartPositionTicks / item.RunTimeTicks
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return markers;
|
return markers;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue