+function getVideoWithAttributes (res: Response) {
+ return res.locals.videoAPI || res.locals.videoAll || res.locals.onlyVideo
+}
+
+function extractVideo (videoOrPlaylist: MVideo | MStreamingPlaylistVideo) {
+ return isStreamingPlaylist(videoOrPlaylist)
+ ? videoOrPlaylist.Video
+ : videoOrPlaylist
+}
+
+function isPrivacyForFederation (privacy: VideoPrivacy) {
+ const castedPrivacy = parseInt(privacy + '', 10)