diff options
Diffstat (limited to 'server/models/video')
-rw-r--r-- | server/models/video/video-file.ts | 8 | ||||
-rw-r--r-- | server/models/video/video.ts | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/server/models/video/video-file.ts b/server/models/video/video-file.ts index 6a321917c..8c8fc0b51 100644 --- a/server/models/video/video-file.ts +++ b/server/models/video/video-file.ts | |||
@@ -311,6 +311,14 @@ export class VideoFileModel extends Model<VideoFileModel> { | |||
311 | return element.save({ transaction }) | 311 | return element.save({ transaction }) |
312 | } | 312 | } |
313 | 313 | ||
314 | static removeHLSFilesOfVideoId (videoStreamingPlaylistId: number) { | ||
315 | const options = { | ||
316 | where: { videoStreamingPlaylistId } | ||
317 | } | ||
318 | |||
319 | return VideoFileModel.destroy(options) | ||
320 | } | ||
321 | |||
314 | getVideoOrStreamingPlaylist (this: MVideoFileVideo | MVideoFileStreamingPlaylistVideo): MVideo | MStreamingPlaylistVideo { | 322 | getVideoOrStreamingPlaylist (this: MVideoFileVideo | MVideoFileStreamingPlaylistVideo): MVideo | MStreamingPlaylistVideo { |
315 | if (this.videoId) return (this as MVideoFileVideo).Video | 323 | if (this.videoId) return (this as MVideoFileVideo).Video |
316 | 324 | ||
diff --git a/server/models/video/video.ts b/server/models/video/video.ts index aba8c8cf4..7e008f7ea 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts | |||
@@ -249,7 +249,7 @@ export type AvailableForListIDsOptions = { | |||
249 | [ScopeNames.WITH_LIVE]: { | 249 | [ScopeNames.WITH_LIVE]: { |
250 | include: [ | 250 | include: [ |
251 | { | 251 | { |
252 | model: VideoLiveModel, | 252 | model: VideoLiveModel.unscoped(), |
253 | required: false | 253 | required: false |
254 | } | 254 | } |
255 | ] | 255 | ] |