- [ScopeNames.WITH_VIDEO_OR_PLAYLIST]: (videoIdOrUUID: string | number) => {
- const where = (typeof videoIdOrUUID === 'number')
- ? { id: videoIdOrUUID }
- : { uuid: videoIdOrUUID }
-
- return {
- include: [
- {
- model: VideoModel.unscoped(),
- required: false,
- where
- },
- {
- model: VideoStreamingPlaylistModel.unscoped(),
- required: false,
- include: [
- {
- model: VideoModel.unscoped(),
- required: true,
- where
- }
- ]
- }
- ]
- }
- },