From 241609f1943effb731e71f11026898e63384b6e4 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 11 Feb 2021 15:51:16 +0100 Subject: [PATCH] Fix NSFW policy in my videos list --- .../src/app/+my-library/my-videos/my-videos.component.html | 1 + client/src/app/+my-library/my-videos/my-videos.component.ts | 6 +++++- .../shared-video-miniature/videos-selection.component.html | 1 + .../shared-video-miniature/videos-selection.component.ts | 3 ++- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/client/src/app/+my-library/my-videos/my-videos.component.html b/client/src/app/+my-library/my-videos/my-videos.component.html index 977f7b03b..5fa4c02ec 100644 --- a/client/src/app/+my-library/my-videos/my-videos.component.html +++ b/client/src/app/+my-library/my-videos/my-videos.component.html @@ -35,6 +35,7 @@ [titlePage]="titlePage" [getVideosObservableFunction]="getVideosObservableFunction" [ownerDisplayType]="ownerDisplayType" + [user]="user" #videosSelection > diff --git a/client/src/app/+my-library/my-videos/my-videos.component.ts b/client/src/app/+my-library/my-videos/my-videos.component.ts index e89bb12e1..6a2a62608 100644 --- a/client/src/app/+my-library/my-videos/my-videos.component.ts +++ b/client/src/app/+my-library/my-videos/my-videos.component.ts @@ -2,7 +2,7 @@ import { concat, Observable, Subject } from 'rxjs' import { debounceTime, tap, toArray } from 'rxjs/operators' import { Component, OnInit, ViewChild } from '@angular/core' import { ActivatedRoute, Router } from '@angular/router' -import { AuthService, ComponentPagination, ConfirmService, Notifier, ScreenService, ServerService } from '@app/core' +import { AuthService, ComponentPagination, ConfirmService, Notifier, ScreenService, ServerService, User, UserService } from '@app/core' import { DisableForReuseHook } from '@app/core/routing/disable-for-reuse-hook' import { immutableAssign } from '@app/helpers' import { DropdownAction, Video, VideoService } from '@app/shared/shared-main' @@ -45,6 +45,8 @@ export class MyVideosComponent implements OnInit, DisableForReuseHook { videosSearchChanged = new Subject() getVideosObservableFunction = this.getVideosObservable.bind(this) + user: User + constructor ( protected router: Router, protected serverService: ServerService, @@ -61,6 +63,8 @@ export class MyVideosComponent implements OnInit, DisableForReuseHook { ngOnInit () { this.buildActions() + this.user = this.authService.getUser() + this.videosSearchChanged .pipe(debounceTime(500)) .subscribe(() => { diff --git a/client/src/app/shared/shared-video-miniature/videos-selection.component.html b/client/src/app/shared/shared-video-miniature/videos-selection.component.html index 5f5593512..8caeaf092 100644 --- a/client/src/app/shared/shared-video-miniature/videos-selection.component.html +++ b/client/src/app/shared/shared-video-miniature/videos-selection.component.html @@ -10,6 +10,7 @@ diff --git a/client/src/app/shared/shared-video-miniature/videos-selection.component.ts b/client/src/app/shared/shared-video-miniature/videos-selection.component.ts index ef59975d4..ca1cf2264 100644 --- a/client/src/app/shared/shared-video-miniature/videos-selection.component.ts +++ b/client/src/app/shared/shared-video-miniature/videos-selection.component.ts @@ -13,7 +13,7 @@ import { TemplateRef } from '@angular/core' import { ActivatedRoute, Router } from '@angular/router' -import { AuthService, ComponentPagination, LocalStorageService, Notifier, ScreenService, ServerService, UserService } from '@app/core' +import { AuthService, ComponentPagination, LocalStorageService, Notifier, ScreenService, ServerService, User, UserService } from '@app/core' import { ResultList, VideoSortField } from '@shared/models' import { PeerTubeTemplateDirective, Video } from '../shared-main' import { AbstractVideoList } from './abstract-video-list' @@ -27,6 +27,7 @@ export type SelectionType = { [ id: number ]: boolean } styleUrls: [ './videos-selection.component.scss' ] }) export class VideosSelectionComponent extends AbstractVideoList implements OnInit, OnDestroy, AfterContentInit { + @Input() user: User @Input() pagination: ComponentPagination @Input() titlePage: string @Input() miniatureDisplayOptions: MiniatureDisplayOptions