mirror of https://github.com/Chocobozzz/PeerTube
Fix playlists with unauthenticated users
parent
72675ebe01
commit
1acd784cf9
|
@ -1,9 +1,7 @@
|
||||||
import { Component, OnDestroy, OnInit } from '@angular/core'
|
import { Component, OnDestroy, OnInit } from '@angular/core'
|
||||||
import { AuthService } from '../../core/auth'
|
|
||||||
import { ConfirmService } from '../../core/confirm'
|
import { ConfirmService } from '../../core/confirm'
|
||||||
import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
|
import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
|
||||||
import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
|
import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
|
||||||
import { flatMap } from 'rxjs/operators'
|
|
||||||
import { Subscription } from 'rxjs'
|
import { Subscription } from 'rxjs'
|
||||||
import { Notifier } from '@app/core'
|
import { Notifier } from '@app/core'
|
||||||
import { VideoPlaylist } from '@app/shared/video-playlist/video-playlist.model'
|
import { VideoPlaylist } from '@app/shared/video-playlist/video-playlist.model'
|
||||||
|
@ -28,7 +26,6 @@ export class VideoChannelPlaylistsComponent implements OnInit, OnDestroy {
|
||||||
private videoChannel: VideoChannel
|
private videoChannel: VideoChannel
|
||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
private authService: AuthService,
|
|
||||||
private notifier: Notifier,
|
private notifier: Notifier,
|
||||||
private confirmService: ConfirmService,
|
private confirmService: ConfirmService,
|
||||||
private videoPlaylistService: VideoPlaylistService,
|
private videoPlaylistService: VideoPlaylistService,
|
||||||
|
@ -57,8 +54,7 @@ export class VideoChannelPlaylistsComponent implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
private loadVideoPlaylists () {
|
private loadVideoPlaylists () {
|
||||||
this.authService.userInformationLoaded
|
this.videoPlaylistService.listChannelPlaylists(this.videoChannel)
|
||||||
.pipe(flatMap(() => this.videoPlaylistService.listChannelPlaylists(this.videoChannel)))
|
|
||||||
.subscribe(res => {
|
.subscribe(res => {
|
||||||
this.videoPlaylists = this.videoPlaylists.concat(res.data)
|
this.videoPlaylists = this.videoPlaylists.concat(res.data)
|
||||||
this.pagination.totalItems = res.total
|
this.pagination.totalItems = res.total
|
||||||
|
|
|
@ -47,7 +47,9 @@ export class VideoWatchPlaylistComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
isPlaylistOwned () {
|
isPlaylistOwned () {
|
||||||
return this.playlist.isLocal === true && this.playlist.ownerAccount.name === this.auth.getUser().username
|
return this.playlist.isLocal === true &&
|
||||||
|
this.auth.isLoggedIn() &&
|
||||||
|
this.playlist.ownerAccount.name === this.auth.getUser().username
|
||||||
}
|
}
|
||||||
|
|
||||||
isUnlistedPlaylist () {
|
isUnlistedPlaylist () {
|
||||||
|
|
Loading…
Reference in New Issue