X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmodels%2Fvideo%2Fvideo-streaming-playlist.ts;h=0386edf2842070ed59624b7aac83eed2e80a5aa1;hb=f713f36bdf6f696ab0fe8a309035a09e864a48ca;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..0386edf28 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' @@ -167,6 +170,22 @@ export class VideoStreamingPlaylistModel extends Model(id, options) + } + static loadWithVideo (id: number) { const options = { include: [ @@ -194,9 +213,22 @@ export class VideoStreamingPlaylistModel extends Model