From 66fb2aa39b6f8e4677f80128c27fbafd3a8fe2e7 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 21 Nov 2019 12:16:27 +0100 Subject: Don't always replace actor avatar --- server/lib/video-paths.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'server/lib/video-paths.ts') diff --git a/server/lib/video-paths.ts b/server/lib/video-paths.ts index 63011cdb2..fe0a004e4 100644 --- a/server/lib/video-paths.ts +++ b/server/lib/video-paths.ts @@ -1,8 +1,8 @@ -import { isStreamingPlaylist, MStreamingPlaylistVideo, MVideo, MVideoFile } from '@server/typings/models' +import { isStreamingPlaylist, MStreamingPlaylistVideo, MVideo, MVideoFile, MVideoUUID } from '@server/typings/models' import { extractVideo } from './videos' import { join } from 'path' import { CONFIG } from '@server/initializers/config' -import { HLS_STREAMING_PLAYLIST_DIRECTORY } from '@server/initializers/constants' +import { HLS_REDUNDANCY_DIRECTORY, HLS_STREAMING_PLAYLIST_DIRECTORY } from '@server/initializers/constants' // ################## Video file name ################## @@ -34,6 +34,14 @@ function getVideoFilePath (videoOrPlaylist: MVideo | MStreamingPlaylistVideo, vi return join(baseDir, getVideoFilename(videoOrPlaylist, videoFile)) } +// ################## Streaming playlist ################## + +function getHLSDirectory (video: MVideoUUID, isRedundancy = false) { + const baseDir = isRedundancy ? HLS_REDUNDANCY_DIRECTORY : HLS_STREAMING_PLAYLIST_DIRECTORY + + return join(baseDir, video.uuid) +} + // ################## Torrents ################## function getTorrentFileName (videoOrPlaylist: MVideo | MStreamingPlaylistVideo, videoFile: MVideoFile) { @@ -60,5 +68,7 @@ export { getVideoFilePath, getTorrentFileName, - getTorrentFilePath + getTorrentFilePath, + + getHLSDirectory } -- cgit v1.2.3