- protected loadRouteParams (routeParams: { [ key: string ]: any }) {
- this.sort = routeParams[ 'sort' ] as VideoSortField || this.defaultSort
- this.categoryOneOf = routeParams[ 'categoryOneOf' ]
- this.angularState = routeParams[ 'a-state' ]
+ protected load () { /* empty */ }
+
+ // Hook if the page has custom route params
+ protected loadPageRouteParams (_queryParams: Params) { /* empty */ }
+
+ protected loadRouteParams (queryParams: Params) {
+ this.sort = queryParams['sort'] as VideoSortField || this.defaultSort
+ this.categoryOneOf = queryParams['categoryOneOf']
+ this.angularState = queryParams['a-state']
+
+ this.loadPageRouteParams(queryParams)
+ }
+
+ protected buildLocalFilter (existing: VideoFilter, base: VideoFilter) {
+ if (base === 'local') {
+ return existing === 'local'
+ ? 'all-local' as 'all-local'
+ : 'local' as 'local'
+ }
+
+ return existing === 'all'
+ ? null
+ : 'all'
+ }
+
+ protected enableAllFilterIfPossible () {
+ if (!this.authService.isLoggedIn()) return
+
+ this.authService.userInformationLoaded
+ .subscribe(() => {
+ const user = this.authService.getUser()
+ this.displayModerationBlock = user.hasRight(UserRight.SEE_ALL_VIDEOS)
+ })