aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-05-13 11:25:13 +0200
committerChocobozzz <me@florianbigard.com>2019-05-13 11:25:13 +0200
commit1acd784cf984bb91d39c37a248805a7f96ea6643 (patch)
tree68bf72fbcf472de4b54dffcd49d0386a0ddbb666
parent72675ebe0181ab2389fb2f75a3b2acdca6e09c07 (diff)
downloadPeerTube-1acd784cf984bb91d39c37a248805a7f96ea6643.tar.gz
PeerTube-1acd784cf984bb91d39c37a248805a7f96ea6643.tar.zst
PeerTube-1acd784cf984bb91d39c37a248805a7f96ea6643.zip
Fix playlists with unauthenticated users
-rw-r--r--client/src/app/+video-channels/video-channel-playlists/video-channel-playlists.component.ts6
-rw-r--r--client/src/app/videos/+video-watch/video-watch-playlist.component.ts4
2 files changed, 4 insertions, 6 deletions
diff --git a/client/src/app/+video-channels/video-channel-playlists/video-channel-playlists.component.ts b/client/src/app/+video-channels/video-channel-playlists/video-channel-playlists.component.ts
index f878a5a24..907aefae1 100644
--- a/client/src/app/+video-channels/video-channel-playlists/video-channel-playlists.component.ts
+++ b/client/src/app/+video-channels/video-channel-playlists/video-channel-playlists.component.ts
@@ -1,9 +1,7 @@
1import { Component, OnDestroy, OnInit } from '@angular/core' 1import { Component, OnDestroy, OnInit } from '@angular/core'
2import { AuthService } from '../../core/auth'
3import { ConfirmService } from '../../core/confirm' 2import { ConfirmService } from '../../core/confirm'
4import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' 3import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
5import { VideoChannel } from '@app/shared/video-channel/video-channel.model' 4import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
6import { flatMap } from 'rxjs/operators'
7import { Subscription } from 'rxjs' 5import { Subscription } from 'rxjs'
8import { Notifier } from '@app/core' 6import { Notifier } from '@app/core'
9import { VideoPlaylist } from '@app/shared/video-playlist/video-playlist.model' 7import { VideoPlaylist } from '@app/shared/video-playlist/video-playlist.model'
@@ -28,7 +26,6 @@ export class VideoChannelPlaylistsComponent implements OnInit, OnDestroy {
28 private videoChannel: VideoChannel 26 private videoChannel: VideoChannel
29 27
30 constructor ( 28 constructor (
31 private authService: AuthService,
32 private notifier: Notifier, 29 private notifier: Notifier,
33 private confirmService: ConfirmService, 30 private confirmService: ConfirmService,
34 private videoPlaylistService: VideoPlaylistService, 31 private videoPlaylistService: VideoPlaylistService,
@@ -57,8 +54,7 @@ export class VideoChannelPlaylistsComponent implements OnInit, OnDestroy {
57 } 54 }
58 55
59 private loadVideoPlaylists () { 56 private loadVideoPlaylists () {
60 this.authService.userInformationLoaded 57 this.videoPlaylistService.listChannelPlaylists(this.videoChannel)
61 .pipe(flatMap(() => this.videoPlaylistService.listChannelPlaylists(this.videoChannel)))
62 .subscribe(res => { 58 .subscribe(res => {
63 this.videoPlaylists = this.videoPlaylists.concat(res.data) 59 this.videoPlaylists = this.videoPlaylists.concat(res.data)
64 this.pagination.totalItems = res.total 60 this.pagination.totalItems = res.total
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 3ac06c099..bccdaf7b2 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
@@ -47,7 +47,9 @@ export class VideoWatchPlaylistComponent {
47 } 47 }
48 48
49 isPlaylistOwned () { 49 isPlaylistOwned () {
50 return this.playlist.isLocal === true && this.playlist.ownerAccount.name === this.auth.getUser().username 50 return this.playlist.isLocal === true &&
51 this.auth.isLoggedIn() &&
52 this.playlist.ownerAccount.name === this.auth.getUser().username
51 } 53 }
52 54
53 isUnlistedPlaylist () { 55 isUnlistedPlaylist () {