+import { Response } from 'express'
+import { CONFIG } from '@server/initializers/config'
+import { isStreamingPlaylist, MStreamingPlaylistVideo, MVideo } from '@server/types/models'
+import { VideoPrivacy, VideoState } from '@shared/models'
+import { forceNumber } from '@shared/core-utils'
+
+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
+}