X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmodels%2Fvideo%2Fvideo-streaming-playlist.ts;h=a85c79c9f1d96c64c2542926aa964954bcfba0b8;hb=2a4c0d8bbe29178ae90e776bb9453f86e6d23bd9;hp=2c4dbd8ec7bb82db7b41026ace0bee259d732798;hpb=3b0525106d8742b5ebd6962219eaf105435f6fb9;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/models/video/video-streaming-playlist.ts b/server/models/video/video-streaming-playlist.ts index 2c4dbd8ec..a85c79c9f 100644 --- a/server/models/video/video-streaming-playlist.ts +++ b/server/models/video/video-streaming-playlist.ts @@ -15,9 +15,12 @@ import { Table, UpdatedAt } from 'sequelize-typescript' -import { getHLSPublicFileUrl } from '@server/lib/object-storage' +import { CONFIG } from '@server/initializers/config' +import { getHLSPrivateFileUrl, getHLSPublicFileUrl } from '@server/lib/object-storage' +import { generateHLSMasterPlaylistFilename, generateHlsSha256SegmentsFilename } from '@server/lib/paths' +import { isVideoInPrivateDirectory } from '@server/lib/video-privacy' import { VideoFileModel } from '@server/models/video/video-file' -import { MStreamingPlaylist, MVideo } from '@server/types/models' +import { MStreamingPlaylist, MStreamingPlaylistFilesVideo, MVideo } from '@server/types/models' import { sha1 } from '@shared/extra-utils' import { VideoStorage } from '@shared/models' import { AttributesOnly } from '@shared/typescript-utils' @@ -34,8 +37,7 @@ import { WEBSERVER } from '../../initializers/constants' import { VideoRedundancyModel } from '../redundancy/video-redundancy' -import { doesExist } from '../shared' -import { throwIfNotValid } from '../utils' +import { doesExist, throwIfNotValid } from '../shared' import { VideoModel } from './video' @Table({ @@ -135,7 +137,7 @@ export class VideoStreamingPlaylistModel extends Model(id, options) + } + static loadWithVideo (id: number) { const options = { include: [ @@ -194,9 +212,22 @@ export class VideoStreamingPlaylistModel extends Model