+ isRegularPlaylist (playlist: VideoPlaylist) {
+ return playlist?.type.id === VideoPlaylistType.REGULAR
+ }
+
+ showShareModal () {
+ this.videoShareModal.show()
+ }
+
+ async deleteVideoPlaylist (videoPlaylist: VideoPlaylist) {
+ const res = await this.confirmService.confirm(
+ this.i18n(
+ 'Do you really want to delete {{playlistDisplayName}}?',
+ { playlistDisplayName: videoPlaylist.displayName }
+ ),
+ this.i18n('Delete')
+ )
+ if (res === false) return
+
+ this.videoPlaylistService.removeVideoPlaylist(videoPlaylist)
+ .subscribe(
+ () => {
+ this.router.navigate([ '/my-account', 'video-playlists' ])
+
+ this.notifier.success(
+ this.i18n('Playlist {{playlistDisplayName}} deleted.', { playlistDisplayName: videoPlaylist.displayName })
+ )
+ },
+
+ error => this.notifier.error(error.message)
+ )
+ }
+