Fix publishedAt after a scheduled update

pull/850/head
Chocobozzz 2018-07-24 15:11:28 +02:00
parent 98d3324db3
commit 77de223a5f
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 3 additions and 2 deletions

View File

@ -43,11 +43,12 @@ export class UpdateVideosScheduler extends AbstractScheduler {
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)
}