-
-// FIXME: Define indexes here because there is an issue with TS and Sequelize.literal when called directly in the annotation
-const indexes: Sequelize.DefineIndexesOptions[] = [
- buildTrigramSearchIndex('video_name_trigram', 'name'),
-
- { fields: [ 'createdAt' ] },
- { fields: [ 'publishedAt' ] },
- { fields: [ 'duration' ] },
- { fields: [ 'views' ] },
- { fields: [ 'channelId' ] },
- {
- fields: [ 'category' ], // We don't care videos with an unknown category
- where: {
- category: {
- [Sequelize.Op.ne]: null
- }
- }
- },
- {
- fields: [ 'licence' ], // We don't care videos with an unknown licence
- where: {
- licence: {
- [Sequelize.Op.ne]: null
- }
- }
- },
- {
- fields: [ 'language' ], // We don't care videos with an unknown language
- where: {
- language: {
- [Sequelize.Op.ne]: null
- }
- }
- },
- {
- fields: [ 'nsfw' ], // Most of the videos are not NSFW
- where: {
- nsfw: true
- }
- },
- {
- fields: [ 'remote' ], // Only index local videos
- where: {
- remote: false
- }
- },
- {
- fields: [ 'uuid' ],
- unique: true
- },
- {
- fields: [ 'url' ],
- unique: true
- }
-]
+import { VideoPlaylistElementModel } from './video-playlist-element'
+import { CONFIG } from '../../initializers/config'
+import { ThumbnailModel } from './thumbnail'
+import { ThumbnailType } from '../../../shared/models/videos/thumbnail.type'
+import { VideoStreamingPlaylistType } from '../../../shared/models/videos/video-streaming-playlist.type'
+import {
+ MChannel,
+ MChannelAccountDefault,
+ MChannelId,
+ MStreamingPlaylist,
+ MStreamingPlaylistFilesVideo,
+ MUserAccountId,
+ MUserId,
+ MVideoAccountLight,
+ MVideoAccountLightBlacklistAllFiles,
+ MVideoAP,
+ MVideoDetails,
+ MVideoFileVideo,
+ MVideoFormattable,
+ MVideoFormattableDetails,
+ MVideoForUser,
+ MVideoFullLight,
+ MVideoIdThumbnail,
+ MVideoThumbnail,
+ MVideoThumbnailBlacklist,
+ MVideoWithAllFiles,
+ MVideoWithFile,
+ MVideoWithRights
+} from '../../typings/models'
+import { MVideoFile, MVideoFileStreamingPlaylistVideo } from '../../typings/models/video/video-file'
+import { MThumbnail } from '../../typings/models/video/thumbnail'
+import { VideoFile } from '@shared/models/videos/video-file.model'
+import { getHLSDirectory, getTorrentFileName, getTorrentFilePath, getVideoFilename, getVideoFilePath } from '@server/lib/video-paths'
+import validator from 'validator'