aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/video-live-session.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/video/video-live-session.ts')
-rw-r--r--server/models/video/video-live-session.ts13
1 files changed, 11 insertions, 2 deletions
diff --git a/server/models/video/video-live-session.ts b/server/models/video/video-live-session.ts
index dcded7872..9426f5d11 100644
--- a/server/models/video/video-live-session.ts
+++ b/server/models/video/video-live-session.ts
@@ -147,12 +147,21 @@ export class VideoLiveSessionModel extends Model<Partial<AttributesOnly<VideoLiv
147 return VideoLiveSessionModel.scope(ScopeNames.WITH_REPLAY).findOne(query) 147 return VideoLiveSessionModel.scope(ScopeNames.WITH_REPLAY).findOne(query)
148 } 148 }
149 149
150 static findCurrentSessionOf (videoId: number) { 150 static findCurrentSessionOf (videoUUID: string) {
151 return VideoLiveSessionModel.findOne({ 151 return VideoLiveSessionModel.findOne({
152 where: { 152 where: {
153 liveVideoId: videoId,
154 endDate: null 153 endDate: null
155 }, 154 },
155 include: [
156 {
157 model: VideoModel.unscoped(),
158 as: 'LiveVideo',
159 required: true,
160 where: {
161 uuid: videoUUID
162 }
163 }
164 ],
156 order: [ [ 'startDate', 'DESC' ] ] 165 order: [ [ 'startDate', 'DESC' ] ]
157 }) 166 })
158 } 167 }