aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-12-10 10:28:46 +0100
committerChocobozzz <me@florianbigard.com>2021-12-10 10:28:46 +0100
commit90701ec1d8d27d0072d6b0d2b19362d471484f9a (patch)
treea03dedc7b6119d9f6d2ea35cae9b2dde20275519 /server/models
parent0fbc0dec59684527fad8772080a8e1f928c07ea1 (diff)
downloadPeerTube-90701ec1d8d27d0072d6b0d2b19362d471484f9a.tar.gz
PeerTube-90701ec1d8d27d0072d6b0d2b19362d471484f9a.tar.zst
PeerTube-90701ec1d8d27d0072d6b0d2b19362d471484f9a.zip
Add hls to prune storage script
Diffstat (limited to 'server/models')
-rw-r--r--server/models/video/video-streaming-playlist.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/server/models/video/video-streaming-playlist.ts b/server/models/video/video-streaming-playlist.ts
index 4643c5452..e36852cad 100644
--- a/server/models/video/video-streaming-playlist.ts
+++ b/server/models/video/video-streaming-playlist.ts
@@ -198,6 +198,15 @@ export class VideoStreamingPlaylistModel extends Model<Partial<AttributesOnly<Vi
198 return Object.assign(playlist, { videoId: video.id, Video: video }) 198 return Object.assign(playlist, { videoId: video.id, Video: video })
199 } 199 }
200 200
201 static doesOwnedHLSPlaylistExist (videoUUID: string) {
202 const query = `SELECT 1 FROM "videoStreamingPlaylist" ` +
203 `INNER JOIN "video" ON "video"."id" = "videoStreamingPlaylist"."videoId" ` +
204 `AND "video"."remote" IS FALSE AND "video"."uuid" = $videoUUID ` +
205 `AND "storage" = ${VideoStorage.FILE_SYSTEM} LIMIT 1`
206
207 return doesExist(query, { videoUUID })
208 }
209
201 assignP2PMediaLoaderInfoHashes (video: MVideo, files: unknown[]) { 210 assignP2PMediaLoaderInfoHashes (video: MVideo, files: unknown[]) {
202 const masterPlaylistUrl = this.getMasterPlaylistUrl(video) 211 const masterPlaylistUrl = this.getMasterPlaylistUrl(video)
203 212