diff options
author | Florian CUNY <poslovitch@bentobox.world> | 2021-04-26 11:01:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-26 11:01:29 +0200 |
commit | e771e82dfac5f8cd5462fecf6618f9b1fb314e30 (patch) | |
tree | 6abf1789ad2603ad975c31b9a513ad60b8fde8d7 /client/src/app/+videos/+video-watch/video-watch-playlist.component.ts | |
parent | fd78d2e247b014fd1561cfb5206c9b8b14d6b820 (diff) | |
download | PeerTube-e771e82dfac5f8cd5462fecf6618f9b1fb314e30.tar.gz PeerTube-e771e82dfac5f8cd5462fecf6618f9b1fb314e30.tar.zst PeerTube-e771e82dfac5f8cd5462fecf6618f9b1fb314e30.zip |
Added "last" and a reversed ?playlistPosition in playlist URL (#3974)
* Added "last" and a reversed playlistPosition
Implements https://github.com/Chocobozzz/PeerTube/issues/3897
* Fixed lint errors in video-watch component
* Applied requested changes
* Removed debug logs
* Fixed lint
* Playlist position styling
Co-authored-by: Chocobozzz <me@florianbigard.com>
Diffstat (limited to 'client/src/app/+videos/+video-watch/video-watch-playlist.component.ts')
-rw-r--r-- | client/src/app/+videos/+video-watch/video-watch-playlist.component.ts | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/client/src/app/+videos/+video-watch/video-watch-playlist.component.ts b/client/src/app/+videos/+video-watch/video-watch-playlist.component.ts index a70167da5..0a4d6bfd1 100644 --- a/client/src/app/+videos/+video-watch/video-watch-playlist.component.ts +++ b/client/src/app/+videos/+video-watch/video-watch-playlist.component.ts | |||
@@ -118,6 +118,9 @@ export class VideoWatchPlaylistComponent { | |||
118 | updatePlaylistIndex (position: number) { | 118 | updatePlaylistIndex (position: number) { |
119 | if (this.playlistElements.length === 0 || !position) return | 119 | if (this.playlistElements.length === 0 || !position) return |
120 | 120 | ||
121 | // Handle the reverse index | ||
122 | if (position < 0) position = this.playlist.videosLength + position + 1 | ||
123 | |||
121 | for (const playlistElement of this.playlistElements) { | 124 | for (const playlistElement of this.playlistElements) { |
122 | // >= if the previous videos were not valid | 125 | // >= if the previous videos were not valid |
123 | if (playlistElement.video && playlistElement.position >= position) { | 126 | if (playlistElement.video && playlistElement.position >= position) { |