@AllowNull(true)
@Default(null)
@Column
- privacy: VideoPrivacy
+ privacy: VideoPrivacy.PUBLIC | VideoPrivacy.UNLISTED
@CreatedAt
createdAt: Date
})
Video: VideoModel
+ static areVideosToUpdate () {
+ const query = {
+ logging: false,
+ attributes: [ 'id' ],
+ where: {
+ updateAt: {
+ [Sequelize.Op.lte]: new Date()
+ }
+ }
+ }
+
+ return ScheduleVideoUpdateModel.findOne(query)
+ .then(res => !!res)
+ }
+
static listVideosToUpdate (t: Transaction) {
const query = {
where: {
return ScheduleVideoUpdateModel.findAll(query)
}
+ toFormattedJSON () {
+ return {
+ updateAt: this.updateAt,
+ privacy: this.privacy || undefined
+ }
+ }
}