]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/video/video-streaming-playlist.ts
Live streaming implementation first step
[github/Chocobozzz/PeerTube.git] / server / models / video / video-streaming-playlist.ts
index 24959621803f8b270039d406f390687658834ef6..b8dc7c450340920a9de516b0cd8f83eb91463835 100644 (file)
@@ -17,7 +17,7 @@ import { join } from 'path'
 import { sha1 } from '../../helpers/core-utils'
 import { isArrayOf } from '../../helpers/custom-validators/misc'
 import { Op, QueryTypes } from 'sequelize'
-import { MStreamingPlaylist, MStreamingPlaylistVideo, MVideoFile } from '@server/typings/models'
+import { MStreamingPlaylist, MStreamingPlaylistVideo, MVideoFile } from '@server/types/models'
 import { VideoFileModel } from '@server/models/video/video-file'
 import { getTorrentFileName, getTorrentFilePath, getVideoFilename } from '@server/lib/video-paths'
 import * as memoizee from 'memoizee'
@@ -173,7 +173,9 @@ export class VideoStreamingPlaylistModel extends Model<VideoStreamingPlaylistMod
     return join(STATIC_PATHS.STREAMING_PLAYLISTS.HLS, videoUUID, VideoStreamingPlaylistModel.getHlsPlaylistFilename(resolution))
   }
 
-  static getHlsSha256SegmentsStaticPath (videoUUID: string) {
+  static getHlsSha256SegmentsStaticPath (videoUUID: string, isLive: boolean) {
+    if (isLive) return join('/live', 'segments-sha256', videoUUID)
+
     return join(STATIC_PATHS.STREAMING_PLAYLISTS.HLS, videoUUID, VideoStreamingPlaylistModel.getHlsSha256SegmentsFilename())
   }