Fix NSFW policy in my videos list

This commit is contained in:
Chocobozzz 2021-02-11 15:51:16 +01:00
parent 20eb3a5be0
commit 241609f194
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
4 changed files with 9 additions and 2 deletions

View File

@ -35,6 +35,7 @@
[titlePage]="titlePage" [titlePage]="titlePage"
[getVideosObservableFunction]="getVideosObservableFunction" [getVideosObservableFunction]="getVideosObservableFunction"
[ownerDisplayType]="ownerDisplayType" [ownerDisplayType]="ownerDisplayType"
[user]="user"
#videosSelection #videosSelection
> >
<ng-template ptTemplate="globalButtons"> <ng-template ptTemplate="globalButtons">

View File

@ -2,7 +2,7 @@ import { concat, Observable, Subject } from 'rxjs'
import { debounceTime, tap, toArray } from 'rxjs/operators' import { debounceTime, tap, toArray } from 'rxjs/operators'
import { Component, OnInit, ViewChild } from '@angular/core' import { Component, OnInit, ViewChild } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router' 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 { DisableForReuseHook } from '@app/core/routing/disable-for-reuse-hook'
import { immutableAssign } from '@app/helpers' import { immutableAssign } from '@app/helpers'
import { DropdownAction, Video, VideoService } from '@app/shared/shared-main' import { DropdownAction, Video, VideoService } from '@app/shared/shared-main'
@ -45,6 +45,8 @@ export class MyVideosComponent implements OnInit, DisableForReuseHook {
videosSearchChanged = new Subject<string>() videosSearchChanged = new Subject<string>()
getVideosObservableFunction = this.getVideosObservable.bind(this) getVideosObservableFunction = this.getVideosObservable.bind(this)
user: User
constructor ( constructor (
protected router: Router, protected router: Router,
protected serverService: ServerService, protected serverService: ServerService,
@ -61,6 +63,8 @@ export class MyVideosComponent implements OnInit, DisableForReuseHook {
ngOnInit () { ngOnInit () {
this.buildActions() this.buildActions()
this.user = this.authService.getUser()
this.videosSearchChanged this.videosSearchChanged
.pipe(debounceTime(500)) .pipe(debounceTime(500))
.subscribe(() => { .subscribe(() => {

View File

@ -10,6 +10,7 @@
<my-video-miniature <my-video-miniature
[video]="video" [displayAsRow]="true" [displayOptions]="miniatureDisplayOptions" [video]="video" [displayAsRow]="true" [displayOptions]="miniatureDisplayOptions"
[displayVideoActions]="false" [ownerDisplayType]="ownerDisplayType" [displayVideoActions]="false" [ownerDisplayType]="ownerDisplayType"
[user]="user"
></my-video-miniature> ></my-video-miniature>
<!-- Display only once --> <!-- Display only once -->

View File

@ -13,7 +13,7 @@ import {
TemplateRef TemplateRef
} from '@angular/core' } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router' 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 { ResultList, VideoSortField } from '@shared/models'
import { PeerTubeTemplateDirective, Video } from '../shared-main' import { PeerTubeTemplateDirective, Video } from '../shared-main'
import { AbstractVideoList } from './abstract-video-list' import { AbstractVideoList } from './abstract-video-list'
@ -27,6 +27,7 @@ export type SelectionType = { [ id: number ]: boolean }
styleUrls: [ './videos-selection.component.scss' ] styleUrls: [ './videos-selection.component.scss' ]
}) })
export class VideosSelectionComponent extends AbstractVideoList implements OnInit, OnDestroy, AfterContentInit { export class VideosSelectionComponent extends AbstractVideoList implements OnInit, OnDestroy, AfterContentInit {
@Input() user: User
@Input() pagination: ComponentPagination @Input() pagination: ComponentPagination
@Input() titlePage: string @Input() titlePage: string
@Input() miniatureDisplayOptions: MiniatureDisplayOptions @Input() miniatureDisplayOptions: MiniatureDisplayOptions