aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/video.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-11-13 14:36:30 +0100
committerChocobozzz <me@florianbigard.com>2020-11-13 14:36:30 +0100
commit5c0904fc664e3eb04ac75a9430c1297c2a14f853 (patch)
tree6ede3183976686f113aca6c06ba36b99cfe965f4 /server/models/video/video.ts
parent786b855af726599a9c877eefa6fa8508c36e1aca (diff)
downloadPeerTube-5c0904fc664e3eb04ac75a9430c1297c2a14f853.tar.gz
PeerTube-5c0904fc664e3eb04ac75a9430c1297c2a14f853.tar.zst
PeerTube-5c0904fc664e3eb04ac75a9430c1297c2a14f853.zip
Cleanup lives on server restart
Diffstat (limited to 'server/models/video/video.ts')
-rw-r--r--server/models/video/video.ts13
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,