aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-08-19 09:21:46 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-08-19 11:30:21 +0200
commitd142c7b9c01735ecebc3511072c0e722ce2edc1b (patch)
tree5dd57fb6ffea64a65528113c332ce7de7ae3563f /client/src/app/shared
parent3c6a44a18175b85d2a3e0b7c3e975718833e5345 (diff)
downloadPeerTube-d142c7b9c01735ecebc3511072c0e722ce2edc1b.tar.gz
PeerTube-d142c7b9c01735ecebc3511072c0e722ce2edc1b.tar.zst
PeerTube-d142c7b9c01735ecebc3511072c0e722ce2edc1b.zip
Use playlistPosition for playlists instead of videoId
Diffstat (limited to 'client/src/app/shared')
-rw-r--r--client/src/app/shared/shared-main/angular/infinite-scroller.directive.ts6
-rw-r--r--client/src/app/shared/shared-share-modal/video-share.component.ts5
-rw-r--r--client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.ts2
3 files changed, 7 insertions, 6 deletions
diff --git a/client/src/app/shared/shared-main/angular/infinite-scroller.directive.ts b/client/src/app/shared/shared-main/angular/infinite-scroller.directive.ts
index f09c3d1fc..d2cf53227 100644
--- a/client/src/app/shared/shared-main/angular/infinite-scroller.directive.ts
+++ b/client/src/app/shared/shared-main/angular/infinite-scroller.directive.ts
@@ -1,6 +1,6 @@
1import { fromEvent, Observable, Subscription } from 'rxjs'
1import { distinctUntilChanged, filter, map, share, startWith, throttleTime } from 'rxjs/operators' 2import { distinctUntilChanged, filter, map, share, startWith, throttleTime } from 'rxjs/operators'
2import { AfterContentChecked, Directive, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core' 3import { AfterContentChecked, Directive, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core'
3import { fromEvent, Observable, Subscription } from 'rxjs'
4 4
5@Directive({ 5@Directive({
6 selector: '[myInfiniteScroller]' 6 selector: '[myInfiniteScroller]'
@@ -80,7 +80,9 @@ export class InfiniteScrollerDirective implements OnInit, OnDestroy, AfterConten
80 } 80 }
81 81
82 private getMaximumScroll () { 82 private getMaximumScroll () {
83 return this.container.scrollHeight - window.innerHeight 83 const elementHeight = this.onItself ? this.container.clientHeight : window.innerHeight
84
85 return this.container.scrollHeight - elementHeight
84 } 86 }
85 87
86 private hasScroll () { 88 private hasScroll () {
diff --git a/client/src/app/shared/shared-share-modal/video-share.component.ts b/client/src/app/shared/shared-share-modal/video-share.component.ts
index 8d8e8a3a5..f57a50770 100644
--- a/client/src/app/shared/shared-share-modal/video-share.component.ts
+++ b/client/src/app/shared/shared-share-modal/video-share.component.ts
@@ -37,6 +37,7 @@ export class VideoShareComponent {
37 @Input() video: VideoDetails = null 37 @Input() video: VideoDetails = null
38 @Input() videoCaptions: VideoCaption[] = [] 38 @Input() videoCaptions: VideoCaption[] = []
39 @Input() playlist: VideoPlaylist = null 39 @Input() playlist: VideoPlaylist = null
40 @Input() playlistPosition: number = null
40 41
41 activeVideoId: TabId = 'url' 42 activeVideoId: TabId = 'url'
42 activePlaylistId: TabId = 'url' 43 activePlaylistId: TabId = 'url'
@@ -45,8 +46,6 @@ export class VideoShareComponent {
45 isAdvancedCustomizationCollapsed = true 46 isAdvancedCustomizationCollapsed = true
46 includeVideoInPlaylist = false 47 includeVideoInPlaylist = false
47 48
48 private playlistPosition: number = null
49
50 constructor (private modalService: NgbModal) { } 49 constructor (private modalService: NgbModal) { }
51 50
52 show (currentVideoTimestamp?: number, currentPlaylistPosition?: number) { 51 show (currentVideoTimestamp?: number, currentPlaylistPosition?: number) {
@@ -107,7 +106,7 @@ export class VideoShareComponent {
107 106
108 if (!this.includeVideoInPlaylist) return base 107 if (!this.includeVideoInPlaylist) return base
109 108
110 return base + '?videoId=' + this.video.uuid 109 return base + '?playlistPosition=' + this.playlistPosition
111 } 110 }
112 111
113 notSecure () { 112 notSecure () {
diff --git a/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.ts b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.ts
index 5879c4978..7c083ae26 100644
--- a/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.ts
+++ b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.ts
@@ -78,7 +78,7 @@ export class VideoPlaylistElementMiniatureComponent implements OnInit {
78 if (!this.playlistElement || !this.playlistElement.video) return {} 78 if (!this.playlistElement || !this.playlistElement.video) return {}
79 79
80 return { 80 return {
81 videoId: this.playlistElement.video.uuid, 81 playlistPosition: this.playlistElement.position,
82 start: this.playlistElement.startTimestamp, 82 start: this.playlistElement.startTimestamp,
83 stop: this.playlistElement.stopTimestamp, 83 stop: this.playlistElement.stopTimestamp,
84 resume: true 84 resume: true