mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Use object to return multiple info instead of array.
This commit is contained in:
parent
b78d6439b0
commit
ba2c365ac9
2 changed files with 15 additions and 15 deletions
|
@ -1577,25 +1577,26 @@ import { setBackdropTransparency, TRANSPARENCY_LEVEL } from '../../../components
|
|||
nowPlayingPositionSlider.getChapterNamesAndFractions = function () {
|
||||
showOsd();
|
||||
|
||||
const markers = [];
|
||||
|
||||
const item = currentItem;
|
||||
|
||||
if (item && item.Chapters && item.Chapters.length) {
|
||||
const chapterNames = [];
|
||||
const chapterFractions = [];
|
||||
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;
|
||||
chapterFractions.push(fraction);
|
||||
chapterNames.push(currentChapter.Name);
|
||||
}
|
||||
|
||||
return [chapterNames, chapterFractions];
|
||||
markers.push({
|
||||
name: currentChapter.Name,
|
||||
progress: fraction
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return [[], []];
|
||||
return markers;
|
||||
};
|
||||
|
||||
view.querySelector('.btnPreviousTrack').addEventListener('click', function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue