X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Fvideo-paths.ts;h=53fc8e81d5fcf6f82cb7016c0747701eb647c9ab;hb=77d7e851dccf17dcc89e8fcc2db3f655d1e63f95;hp=a35661f02823c88ad847eef944a9769ae3aa0979;hpb=26d6bf6533023326fa017812cf31bbe20c752d36;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/video-paths.ts b/server/lib/video-paths.ts index a35661f02..53fc8e81d 100644 --- a/server/lib/video-paths.ts +++ b/server/lib/video-paths.ts @@ -9,7 +9,7 @@ import { extractVideo } from '@server/helpers/video' function getVideoFilename (videoOrPlaylist: MVideo | MStreamingPlaylistVideo, videoFile: MVideoFile) { const video = extractVideo(videoOrPlaylist) - if (isStreamingPlaylist(videoOrPlaylist)) { + if (videoFile.isHLS()) { return generateVideoStreamingPlaylistName(video.uuid, videoFile.resolution) } @@ -25,9 +25,10 @@ function generateWebTorrentVideoName (uuid: string, resolution: number, extname: } function getVideoFilePath (videoOrPlaylist: MVideo | MStreamingPlaylistVideo, videoFile: MVideoFile, isRedundancy = false) { - if (isStreamingPlaylist(videoOrPlaylist)) { + if (videoFile.isHLS()) { const video = extractVideo(videoOrPlaylist) - return join(HLS_STREAMING_PLAYLIST_DIRECTORY, video.uuid, getVideoFilename(videoOrPlaylist, videoFile)) + + return join(getHLSDirectory(video), getVideoFilename(videoOrPlaylist, videoFile)) } const baseDir = isRedundancy ? CONFIG.STORAGE.REDUNDANCY_DIR : CONFIG.STORAGE.VIDEOS_DIR