From 2760b454a761f6af3138b2fb5f34340772ab0d1e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 27 Oct 2021 14:37:04 +0200 Subject: Deprecate filter video query Introduce include and isLocal instead --- .../overview/videos/video-list.component.html | 13 +++++++-- .../overview/videos/video-list.component.scss | 2 ++ .../+admin/overview/videos/video-list.component.ts | 32 ++++++++++++++++++++-- 3 files changed, 41 insertions(+), 6 deletions(-) (limited to 'client/src/app/+admin/overview') diff --git a/client/src/app/+admin/overview/videos/video-list.component.html b/client/src/app/+admin/overview/videos/video-list.component.html index 1f1e9cc6e..6250c00fb 100644 --- a/client/src/app/+admin/overview/videos/video-list.component.html +++ b/client/src/app/+admin/overview/videos/video-list.component.html @@ -63,10 +63,17 @@ - - {{ video.privacy.label }} + + {{ video.privacy.label }} + NSFW - NSFW + + Not published yet + + Account muted + Server muted + + Blocked diff --git a/client/src/app/+admin/overview/videos/video-list.component.scss b/client/src/app/+admin/overview/videos/video-list.component.scss index fcdb457f2..250a917e4 100644 --- a/client/src/app/+admin/overview/videos/video-list.component.scss +++ b/client/src/app/+admin/overview/videos/video-list.component.scss @@ -7,4 +7,6 @@ my-embed { .badge { @include table-badge; + + margin-right: 5px; } diff --git a/client/src/app/+admin/overview/videos/video-list.component.ts b/client/src/app/+admin/overview/videos/video-list.component.ts index a445bc209..dd9225e6a 100644 --- a/client/src/app/+admin/overview/videos/video-list.component.ts +++ b/client/src/app/+admin/overview/videos/video-list.component.ts @@ -3,7 +3,7 @@ import { Component, OnInit } from '@angular/core' import { ActivatedRoute, Router } from '@angular/router' import { AuthService, ConfirmService, Notifier, RestPagination, RestTable } from '@app/core' import { DropdownAction, Video, VideoService } from '@app/shared/shared-main' -import { UserRight } from '@shared/models' +import { UserRight, VideoPrivacy, VideoState } from '@shared/models' import { AdvancedInputFilter } from '@app/shared/shared-forms' import { VideoActionsDisplayType } from '@app/shared/shared-video-miniature' @@ -28,8 +28,12 @@ export class VideoListComponent extends RestTable implements OnInit { title: $localize`Advanced filters`, children: [ { - queryParams: { search: 'local:true' }, - label: $localize`Only local videos` + queryParams: { search: 'isLocal:false' }, + label: $localize`Remote videos` + }, + { + queryParams: { search: 'isLocal:true' }, + label: $localize`Local videos` } ] } @@ -88,6 +92,28 @@ export class VideoListComponent extends RestTable implements OnInit { this.reloadData() } + getPrivacyBadgeClass (privacy: VideoPrivacy) { + if (privacy === VideoPrivacy.PUBLIC) return 'badge-blue' + + return 'badge-yellow' + } + + isUnpublished (state: VideoState) { + return state !== VideoState.PUBLISHED + } + + isAccountBlocked (video: Video) { + return video.blockedOwner + } + + isServerBlocked (video: Video) { + return video.blockedServer + } + + isVideoBlocked (video: Video) { + return video.blacklisted + } + protected reloadData () { this.selectedVideos = [] -- cgit v1.2.3