-import { isTestInstance } from '../../helpers/core-utils'
import { logger } from '../../helpers/logger'
-import { JobQueue } from '../job-queue'
import { AbstractScheduler } from './abstract-scheduler'
import { ScheduleVideoUpdateModel } from '../../models/video/schedule-video-update'
import { retryTransactionWrapper } from '../../helpers/database-utils'
if (schedule.privacy) {
const oldPrivacy = video.privacy
+ const isNewVideo = oldPrivacy === VideoPrivacy.PRIVATE
video.privacy = schedule.privacy
- await video.save({ transaction: t })
+ if (isNewVideo === true) video.publishedAt = new Date()
- const isNewVideo = oldPrivacy === VideoPrivacy.PRIVATE
+ await video.save({ transaction: t })
await federateVideoIfNeeded(video, isNewVideo, t)
}