diff options
author | Chocobozzz <me@florianbigard.com> | 2020-11-13 14:36:30 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-11-13 14:36:30 +0100 |
commit | 5c0904fc664e3eb04ac75a9430c1297c2a14f853 (patch) | |
tree | 6ede3183976686f113aca6c06ba36b99cfe965f4 /server/models/video | |
parent | 786b855af726599a9c877eefa6fa8508c36e1aca (diff) | |
download | PeerTube-5c0904fc664e3eb04ac75a9430c1297c2a14f853.tar.gz PeerTube-5c0904fc664e3eb04ac75a9430c1297c2a14f853.tar.zst PeerTube-5c0904fc664e3eb04ac75a9430c1297c2a14f853.zip |
Cleanup lives on server restart
Diffstat (limited to 'server/models/video')
-rw-r--r-- | server/models/video/video.ts | 13 |
1 files changed, 13 insertions, 0 deletions
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<VideoModel> { | |||
988 | }) | 988 | }) |
989 | } | 989 | } |
990 | 990 | ||
991 | static listPublishedLiveIds () { | ||
992 | const options = { | ||
993 | attributes: [ 'id' ], | ||
994 | where: { | ||
995 | isLive: true, | ||
996 | state: VideoState.PUBLISHED | ||
997 | } | ||
998 | } | ||
999 | |||
1000 | return VideoModel.findAll(options) | ||
1001 | .map(v => v.id) | ||
1002 | } | ||
1003 | |||
991 | static listUserVideosForApi ( | 1004 | static listUserVideosForApi ( |
992 | accountId: number, | 1005 | accountId: number, |
993 | start: number, | 1006 | start: number, |