From 5c0904fc664e3eb04ac75a9430c1297c2a14f853 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 13 Nov 2020 14:36:30 +0100 Subject: Cleanup lives on server restart --- server/models/video/video.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'server/models/video') diff --git a/server/models/video/video.ts b/server/models/video/video.ts index 70839aa89..f3055a494 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts @@ -988,6 +988,19 @@ export class VideoModel extends Model { }) } + static listPublishedLiveIds () { + const options = { + attributes: [ 'id' ], + where: { + isLive: true, + state: VideoState.PUBLISHED + } + } + + return VideoModel.findAll(options) + .map(v => v.id) + } + static listUserVideosForApi ( accountId: number, start: number, -- cgit v1.2.3