]
this.paramsSub = this.route.params.subscribe(routeParams => {
- this.videoPlaylistId = routeParams[ 'videoPlaylistId' ]
+ this.videoPlaylistId = routeParams['videoPlaylistId']
this.loadElements()
this.loadPlaylistInfo()
this.playlistElements.splice(newIndex, 0, element)
this.videoPlaylistService.reorderPlaylist(this.playlist.id, oldPosition, insertAfter)
- .subscribe(
- () => {
+ .subscribe({
+ next: () => {
this.reorderClientPositions()
},
- err => this.notifier.error(err.message)
- )
+ error: err => this.notifier.error(err.message)
+ })
}
onElementRemoved (element: VideoPlaylistElement) {
if (res === false) return
this.videoPlaylistService.removeVideoPlaylist(videoPlaylist)
- .subscribe(
- () => {
+ .subscribe({
+ next: () => {
this.router.navigate([ '/my-library', 'video-playlists' ])
this.notifier.success($localize`Playlist ${videoPlaylist.displayName} deleted.`)
},
- error => this.notifier.error(error.message)
- )
+ error: err => this.notifier.error(err.message)
+ })
}
/**
* we add a delay to prevent unwanted drag&drop.
*
* @see {@link https://github.com/Chocobozzz/PeerTube/issues/2078}
- *
- * @returns {null|number} Null for no delay, or a number in milliseconds.
*/
getDragStartDelay (): null | number {
if (this.screenService.isInTouchScreen()) {
}
private loadElements () {
- this.videoPlaylistService.getPlaylistVideos(this.videoPlaylistId, this.pagination)
+ this.videoPlaylistService.getPlaylistVideos({ videoPlaylistId: this.videoPlaylistId, componentPagination: this.pagination })
.subscribe(({ total, data }) => {
this.playlistElements = this.playlistElements.concat(data)
this.pagination.totalItems = total
// Reload playlist thumbnail if the first element changed
const newFirst = this.findFirst()
if (oldFirst && newFirst && oldFirst.id !== newFirst.id) {
- this.playlist.refreshThumbnail()
+ this.loadPlaylistInfo()
}
}