import { isActivityPubUrlValid, isUrlValid } from '../../helpers/custom-validators/activitypub/misc'
import { CONSTRAINTS_FIELDS, MIMETYPES } from '../../initializers/constants'
import { VideoFileModel } from '../video/video-file'
-import { getServerActor } from '../../helpers/utils'
import { VideoModel } from '../video/video'
import { VideoRedundancyStrategy, VideoRedundancyStrategyWithManual } from '../../../shared/models/redundancy'
import { logger } from '../../helpers/logger'
import { col, FindOptions, fn, literal, Op, Transaction, WhereOptions } from 'sequelize'
import { VideoStreamingPlaylistModel } from '../video/video-streaming-playlist'
import { CONFIG } from '../../initializers/config'
-import { MVideoForRedundancyAPI, MVideoRedundancy, MVideoRedundancyAP, MVideoRedundancyVideo } from '@server/typings/models'
+import { MVideoForRedundancyAPI, MVideoRedundancy, MVideoRedundancyAP, MVideoRedundancyVideo } from '@server/types/models'
import { VideoRedundanciesTarget } from '@shared/models/redundancy/video-redundancies-filters.model'
import {
FileRedundancyInformation,
StreamingPlaylistRedundancyInformation,
VideoRedundancy
} from '@shared/models/redundancy/video-redundancy.model'
+import { getServerActor } from '@server/models/application/application'
export enum ScopeNames {
WITH_VIDEO = 'WITH_VIDEO'
limit: randomizedFactor,
order: getVideoSort('-views'),
where: {
- privacy: VideoPrivacy.PUBLIC
+ privacy: VideoPrivacy.PUBLIC,
+ isLive: false
},
include: [
await VideoRedundancyModel.buildVideoFileForDuplication(),
limit: randomizedFactor,
order: getVideoSort('-trending'),
where: {
- privacy: VideoPrivacy.PUBLIC
+ privacy: VideoPrivacy.PUBLIC,
+ isLive: false
},
include: [
await VideoRedundancyModel.buildVideoFileForDuplication(),
order: getVideoSort('-publishedAt'),
where: {
privacy: VideoPrivacy.PUBLIC,
+ isLive: false,
views: {
[Op.gte]: minViews
}
include: [
{
required: false,
- model: VideoFileModel.unscoped(),
+ model: VideoFileModel,
include: [
{
model: VideoRedundancyModel.unscoped(),
where: redundancyWhere
},
{
- model: VideoFileModel.unscoped(),
+ model: VideoFileModel,
required: false
}
]
return {
attributes: [],
- model: VideoFileModel.unscoped(),
+ model: VideoFileModel,
required: true,
where: {
id: {