+import { Subject, Subscription } from 'rxjs'
import { Component, OnDestroy, OnInit } from '@angular/core'
-import { ConfirmService } from '../../core/confirm'
-import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
-import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
-import { Subscription } from 'rxjs'
-import { Notifier } from '@app/core'
-import { VideoPlaylist } from '@app/shared/video-playlist/video-playlist.model'
-import { ComponentPagination, hasMoreItems } from '@app/shared/rest/component-pagination.model'
-import { VideoPlaylistService } from '@app/shared/video-playlist/video-playlist.service'
+import { ComponentPagination, hasMoreItems, ScreenService } from '@app/core'
+import { VideoChannel, VideoChannelService } from '@app/shared/shared-main'
+import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist'
@Component({
selector: 'my-video-channel-playlists',
totalItems: null
}
+ onDataSubject = new Subject<any[]>()
+
private videoChannelSub: Subscription
private videoChannel: VideoChannel
constructor (
- private notifier: Notifier,
- private confirmService: ConfirmService,
private videoPlaylistService: VideoPlaylistService,
- private videoChannelService: VideoChannelService
+ private videoChannelService: VideoChannelService,
+ private screenService: ScreenService
) {}
ngOnInit () {
this.loadVideoPlaylists()
}
+ displayAsRow () {
+ return this.screenService.isInMobileView()
+ }
+
private loadVideoPlaylists () {
- this.videoPlaylistService.listChannelPlaylists(this.videoChannel)
+ this.videoPlaylistService.listChannelPlaylists(this.videoChannel, this.pagination)
.subscribe(res => {
this.videoPlaylists = this.videoPlaylists.concat(res.data)
this.pagination.totalItems = res.total
+
+ this.onDataSubject.next(res.data)
})
}
}