diff options
author | Chocobozzz <me@florianbigard.com> | 2019-11-21 12:16:27 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-11-25 10:59:44 +0100 |
commit | 66fb2aa39b6f8e4677f80128c27fbafd3a8fe2e7 (patch) | |
tree | 9d2f21e81cc42d8d51ac7ae35d91c30f143f0be0 /server/lib/video-paths.ts | |
parent | d7a25329f9e607894d29ab342b9cb66638b56dc0 (diff) | |
download | PeerTube-66fb2aa39b6f8e4677f80128c27fbafd3a8fe2e7.tar.gz PeerTube-66fb2aa39b6f8e4677f80128c27fbafd3a8fe2e7.tar.zst PeerTube-66fb2aa39b6f8e4677f80128c27fbafd3a8fe2e7.zip |
Don't always replace actor avatar
Diffstat (limited to 'server/lib/video-paths.ts')
-rw-r--r-- | server/lib/video-paths.ts | 16 |
1 files changed, 13 insertions, 3 deletions
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 @@ | |||
1 | import { isStreamingPlaylist, MStreamingPlaylistVideo, MVideo, MVideoFile } from '@server/typings/models' | 1 | import { isStreamingPlaylist, MStreamingPlaylistVideo, MVideo, MVideoFile, MVideoUUID } from '@server/typings/models' |
2 | import { extractVideo } from './videos' | 2 | import { extractVideo } from './videos' |
3 | import { join } from 'path' | 3 | import { join } from 'path' |
4 | import { CONFIG } from '@server/initializers/config' | 4 | import { CONFIG } from '@server/initializers/config' |
5 | import { HLS_STREAMING_PLAYLIST_DIRECTORY } from '@server/initializers/constants' | 5 | import { HLS_REDUNDANCY_DIRECTORY, HLS_STREAMING_PLAYLIST_DIRECTORY } from '@server/initializers/constants' |
6 | 6 | ||
7 | // ################## Video file name ################## | 7 | // ################## Video file name ################## |
8 | 8 | ||
@@ -34,6 +34,14 @@ function getVideoFilePath (videoOrPlaylist: MVideo | MStreamingPlaylistVideo, vi | |||
34 | return join(baseDir, getVideoFilename(videoOrPlaylist, videoFile)) | 34 | return join(baseDir, getVideoFilename(videoOrPlaylist, videoFile)) |
35 | } | 35 | } |
36 | 36 | ||
37 | // ################## Streaming playlist ################## | ||
38 | |||
39 | function getHLSDirectory (video: MVideoUUID, isRedundancy = false) { | ||
40 | const baseDir = isRedundancy ? HLS_REDUNDANCY_DIRECTORY : HLS_STREAMING_PLAYLIST_DIRECTORY | ||
41 | |||
42 | return join(baseDir, video.uuid) | ||
43 | } | ||
44 | |||
37 | // ################## Torrents ################## | 45 | // ################## Torrents ################## |
38 | 46 | ||
39 | function getTorrentFileName (videoOrPlaylist: MVideo | MStreamingPlaylistVideo, videoFile: MVideoFile) { | 47 | function getTorrentFileName (videoOrPlaylist: MVideo | MStreamingPlaylistVideo, videoFile: MVideoFile) { |
@@ -60,5 +68,7 @@ export { | |||
60 | getVideoFilePath, | 68 | getVideoFilePath, |
61 | 69 | ||
62 | getTorrentFileName, | 70 | getTorrentFileName, |
63 | getTorrentFilePath | 71 | getTorrentFilePath, |
72 | |||
73 | getHLSDirectory | ||
64 | } | 74 | } |