aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/video-file.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-11-03 15:33:30 +0100
committerChocobozzz <chocobozzz@cpy.re>2020-11-09 15:33:04 +0100
commit97969c4edf51b37eee691adba43368bb0fbb729b (patch)
treec1089f898fb936d75651630afcf406995eeb9fba /server/models/video/video-file.ts
parentaf4ae64f6faf38f8179f2e07d3cd4ad60006be92 (diff)
downloadPeerTube-97969c4edf51b37eee691adba43368bb0fbb729b.tar.gz
PeerTube-97969c4edf51b37eee691adba43368bb0fbb729b.tar.zst
PeerTube-97969c4edf51b37eee691adba43368bb0fbb729b.zip
Add check constraints live tests
Diffstat (limited to 'server/models/video/video-file.ts')
-rw-r--r--server/models/video/video-file.ts8
1 files changed, 8 insertions, 0 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