From d5d9c5b79edf613e97a752a3d59062fb42045275 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 3 Nov 2021 09:59:53 +0100 Subject: Add ability to filter live videos --- .../app/+admin/overview/videos/video-admin.service.ts | 18 ++++++++++++++++++ .../app/+admin/overview/videos/video-list.component.ts | 5 ++++- 2 files changed, 22 insertions(+), 1 deletion(-) (limited to 'client/src/app') diff --git a/client/src/app/+admin/overview/videos/video-admin.service.ts b/client/src/app/+admin/overview/videos/video-admin.service.ts index 696609cb2..d0854a2dc 100644 --- a/client/src/app/+admin/overview/videos/video-admin.service.ts +++ b/client/src/app/+admin/overview/videos/video-admin.service.ts @@ -40,6 +40,20 @@ export class VideoAdminService { buildAdminInputFilter (): AdvancedInputFilter[] { return [ + { + title: $localize`Video type`, + children: [ + { + queryParams: { search: 'isLive:false' }, + label: $localize`VOD videos` + }, + { + queryParams: { search: 'isLive:true' }, + label: $localize`Live videos` + } + ] + }, + { title: $localize`Videos scope`, children: [ @@ -80,6 +94,10 @@ export class VideoAdminService { prefix: 'isLocal:', isBoolean: true }, + isLive: { + prefix: 'isLive:', + isBoolean: true + }, excludeMuted: { prefix: 'excludeMuted', handler: () => true 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 b0e476569..8a15e8426 100644 --- a/client/src/app/+admin/overview/videos/video-list.component.ts +++ b/client/src/app/+admin/overview/videos/video-list.component.ts @@ -108,7 +108,10 @@ export class VideoListComponent extends RestTable implements OnInit { } isHLS (video: Video) { - return video.streamingPlaylists.some(p => p.type === VideoStreamingPlaylistType.HLS) + const p = video.streamingPlaylists.find(p => p.type === VideoStreamingPlaylistType.HLS) + if (!p) return false + + return p.files.length !== 0 } isWebTorrent (video: Video) { -- cgit v1.2.3