From 9aea7e39279cdb6c00b6f6a131d997e3a149d4fb Mon Sep 17 00:00:00 2001 From: Viperinius Date: Sat, 1 Oct 2022 16:09:25 +0200 Subject: [PATCH] Update getMarkerInfo syntax as suggested --- src/controllers/playback/video/index.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/controllers/playback/video/index.js b/src/controllers/playback/video/index.js index f5abc652b9..efad883f20 100644 --- a/src/controllers/playback/video/index.js +++ b/src/controllers/playback/video/index.js @@ -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;