1 import { Op } from 'sequelize'
11 } from 'sequelize-typescript'
12 import { AttributesOnly } from '@shared/typescript-utils'
13 import { VideoModel } from './video'
16 tableName: 'videoSource',
19 fields: [ 'videoId' ],
28 export class VideoSourceModel extends Model<Partial<AttributesOnly<VideoSourceModel>>> {
39 @ForeignKey(() => VideoModel)
43 @BelongsTo(() => VideoModel)
46 static loadByVideoId (videoId) {
47 return VideoSourceModel.findOne({ where: { videoId } })
52 filename: this.filename