import { isVideoMagnetUriValid } from '../../helpers/custom-validators/videos'
import { UserModel } from '../account/user'
import * as Bluebird from 'bluebird'
-import { MVideoImportDefault } from '@server/typings/models/video/video-import'
+import { MVideoImportDefault, MVideoImportFormattable } from '@server/typings/models/video/video-import'
@DefaultScope(() => ({
include: [
distinct: true,
include: [
{
+ attributes: [ 'id' ],
model: UserModel.unscoped(), // FIXME: Without this, sequelize try to COUNT(DISTINCT(*)) which is an invalid SQL query
required: true
}
return this.targetUrl || this.magnetUri || this.torrentName
}
- toFormattedJSON (): VideoImport {
+ toFormattedJSON (this: MVideoImportFormattable): VideoImport {
const videoFormatOptions = {
completeDescription: true,
additionalAttributes: { state: true, waitTranscoding: true, scheduledUpdate: true }