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;
|
||||
|
||||
// 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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue