.pipe(
debounceTime(500))
.subscribe(() => {
- this.loadVideoPlaylists()
+ this.loadVideoPlaylists(true)
})
}
this.videoPlaylistSearchChanged.next()
}
- private loadVideoPlaylists () {
+ private loadVideoPlaylists (reset = false) {
this.authService.userInformationLoaded
.pipe(flatMap(() => {
return this.videoPlaylistService.listAccountPlaylists(this.user.account, this.pagination, '-updatedAt', this.videoPlaylistsSearch)
}))
.subscribe(res => {
- this.videoPlaylists = []
+ if (reset) this.videoPlaylists = []
this.videoPlaylists = this.videoPlaylists.concat(res.data)
this.pagination.totalItems = res.total
this.loadMoreVideos()
}
- loadMoreVideos () {
+ loadMoreVideos (reset = false) {
this.getVideosObservable(this.pagination.currentPage).subscribe(
({ data, total }) => {
this.pagination.totalItems = total
- this.videos = []
+ if (reset) this.videos = []
this.videos = this.videos.concat(data)
if (this.groupByDate) this.buildGroupedDateLabels()
reloadVideos () {
this.pagination.currentPage = 1
- this.loadMoreVideos()
+ this.loadMoreVideos(true)
}
toggleModerationDisplay () {
import { Hotkey, HotkeysService } from 'angular2-hotkeys'
import { ServerConfig, UserVideoRateType, VideoCaption, VideoPrivacy, VideoState } from '../../../../../shared'
import { AuthService, ConfirmService } from '../../core'
-import { RestExtractor, VideoBlacklistService } from '../../shared'
+import { RestExtractor } from '../../shared'
import { VideoDetails } from '../../shared/video/video-details.model'
import { VideoService } from '../../shared/video/video.service'
import { VideoShareComponent } from './modal/video-share.component'
import { isWebRTCDisabled, timeToInt } from '../../../assets/player/utils'
import { VideoWatchPlaylistComponent } from '@app/videos/+video-watch/video-watch-playlist.component'
import { getStoredTheater } from '../../../assets/player/peertube-player-local-storage'
-import { PluginService } from '@app/core/plugins/plugin.service'
import { HooksService } from '@app/core/plugins/hooks.service'
import { PlatformLocation } from '@angular/common'
import { RecommendedVideosComponent } from '../recommendations/recommended-videos.component'
-import { scrollToTop, isInViewport, isXPercentInViewport } from '@app/shared/misc/utils'
+import { scrollToTop, isXPercentInViewport } from '@app/shared/misc/utils'
@Component({
selector: 'my-video-watch',
private router: Router,
private videoService: VideoService,
private playlistService: VideoPlaylistService,
- private videoBlacklistService: VideoBlacklistService,
private confirmService: ConfirmService,
private metaService: MetaService,
private authService: AuthService,
private serverService: ServerService,
private restExtractor: RestExtractor,
private notifier: Notifier,
- private pluginService: PluginService,
private markdownService: MarkdownService,
private zone: NgZone,
private redirectService: RedirectService,
videoId2 = (await uploadVideoAndGetId({ server, videoName: 'video 2' })).id
{
- const res = await getAccountPlaylistsListWithToken(server.url, server.accessToken, 'root',0, 5, VideoPlaylistType.WATCH_LATER)
+ const res = await getAccountPlaylistsListWithToken(server.url, server.accessToken, 'root', 0, 5, VideoPlaylistType.WATCH_LATER)
watchLaterPlaylistId = res.body.data[0].id
}