1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 18:29:27 +02:00

Don't always replace actor avatar

This commit is contained in:
Chocobozzz 2019-11-21 12:16:27 +01:00
parent d7a25329f9
commit 66fb2aa39b
No known key found for this signature in database
GPG key ID: 583A612D890159BE
7 changed files with 60 additions and 37 deletions

View file

@ -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
}