2022-09-13 05:00:13 -05:00
|
|
|
import { VideoDetails } from '../../models/videos/video.model'
|
2021-11-12 07:19:56 -06:00
|
|
|
import { VideoPrivacy } from '../../models/videos/video-privacy.enum'
|
|
|
|
|
|
|
|
function getAllPrivacies () {
|
|
|
|
return [ VideoPrivacy.PUBLIC, VideoPrivacy.INTERNAL, VideoPrivacy.PRIVATE, VideoPrivacy.UNLISTED ]
|
|
|
|
}
|
|
|
|
|
2022-09-13 05:00:13 -05:00
|
|
|
function getAllFiles (video: Partial<Pick<VideoDetails, 'files' | 'streamingPlaylists'>>) {
|
|
|
|
const files = video.files
|
|
|
|
|
|
|
|
if (video.streamingPlaylists[0]) {
|
|
|
|
return files.concat(video.streamingPlaylists[0].files)
|
|
|
|
}
|
|
|
|
|
|
|
|
return files
|
|
|
|
}
|
|
|
|
|
2021-11-12 07:19:56 -06:00
|
|
|
export {
|
2022-09-13 05:00:13 -05:00
|
|
|
getAllPrivacies,
|
|
|
|
getAllFiles
|
2021-11-12 07:19:56 -06:00
|
|
|
}
|