aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/standalone/videos/shared/playlist-tracker.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/standalone/videos/shared/playlist-tracker.ts')
-rw-r--r--client/src/standalone/videos/shared/playlist-tracker.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/client/src/standalone/videos/shared/playlist-tracker.ts b/client/src/standalone/videos/shared/playlist-tracker.ts
index 9ea4be83f..d8708826d 100644
--- a/client/src/standalone/videos/shared/playlist-tracker.ts
+++ b/client/src/standalone/videos/shared/playlist-tracker.ts
@@ -32,7 +32,7 @@ export class PlaylistTracker {
32 32
33 const next = this.playlistElements.find(e => e.position === position) 33 const next = this.playlistElements.find(e => e.position === position)
34 34
35 if (!next || !next.video) { 35 if (!next?.video) {
36 return this.getNextPlaylistElement(position + 1) 36 return this.getNextPlaylistElement(position + 1)
37 } 37 }
38 38
@@ -52,7 +52,7 @@ export class PlaylistTracker {
52 52
53 const prev = this.playlistElements.find(e => e.position === position) 53 const prev = this.playlistElements.find(e => e.position === position)
54 54
55 if (!prev || !prev.video) { 55 if (!prev?.video) {
56 return this.getNextPlaylistElement(position - 1) 56 return this.getNextPlaylistElement(position - 1)
57 } 57 }
58 58
@@ -68,7 +68,7 @@ export class PlaylistTracker {
68 68
69 setPosition (position: number) { 69 setPosition (position: number) {
70 this.currentPlaylistElement = this.playlistElements.find(e => e.position === position) 70 this.currentPlaylistElement = this.playlistElements.find(e => e.position === position)
71 if (!this.currentPlaylistElement || !this.currentPlaylistElement.video) { 71 if (!this.currentPlaylistElement?.video) {
72 logger.error('Current playlist element is not valid.', this.currentPlaylistElement) 72 logger.error('Current playlist element is not valid.', this.currentPlaylistElement)
73 this.currentPlaylistElement = this.getNextPlaylistElement() 73 this.currentPlaylistElement = this.getNextPlaylistElement()
74 } 74 }