import { CdkDragDrop } from '@angular/cdk/drag-drop'
import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
-import { ComponentPagination, ConfirmService, Notifier, ScreenService } from '@app/core'
+import { ComponentPagination, ConfirmService, HooksService, Notifier, ScreenService } from '@app/core'
import { DropdownAction } from '@app/shared/shared-main'
import { VideoShareComponent } from '@app/shared/shared-share-modal'
import { VideoPlaylist, VideoPlaylistElement, VideoPlaylistService } from '@app/shared/shared-video-playlist'
private paramsSub: Subscription
constructor (
+ private hooks: HooksService,
private notifier: Notifier,
private router: Router,
private confirmService: ConfirmService,
}
private loadElements () {
- this.videoPlaylistService.getPlaylistVideos({ videoPlaylistId: this.videoPlaylistId, componentPagination: this.pagination })
+ this.hooks.wrapObsFun(
+ this.videoPlaylistService.getPlaylistVideos.bind(this.videoPlaylistService),
+ { videoPlaylistId: this.videoPlaylistId, componentPagination: this.pagination },
+ 'my-library',
+ 'filter:api.my-library.video-playlist-elements.list.params',
+ 'filter:api.my-library.video-playlist-elements.list.result'
+ )
.subscribe(({ total, data }) => {
this.playlistElements = this.playlistElements.concat(data)
this.pagination.totalItems = total
signup: new ReplaySubject<boolean>(1),
login: new ReplaySubject<boolean>(1),
'video-edit': new ReplaySubject<boolean>(1),
- embed: new ReplaySubject<boolean>(1)
+ embed: new ReplaySubject<boolean>(1),
+ 'my-library': new ReplaySubject<boolean>(1)
}
private readonly peertubeHelpersFactory: PeertubeHelpersFactory
// Filter form
'filter:api.signup.registration.create.params': true,
+ // Filter params/result of the function that fetch video playlist elements of the my-library page
+ 'filter:api.my-library.video-playlist-elements.list.params': true,
+ 'filter:api.my-library.video-playlist-elements.list.result': true,
+
// Filter the options to create our player
'filter:internal.video-watch.player.build-options.params': true,
'filter:internal.video-watch.player.build-options.result': true,