mirror of https://github.com/Chocobozzz/PeerTube
Fix publishedAt after a scheduled update
parent
98d3324db3
commit
77de223a5f
|
@ -43,11 +43,12 @@ export class UpdateVideosScheduler extends AbstractScheduler {
|
||||||
|
|
||||||
if (schedule.privacy) {
|
if (schedule.privacy) {
|
||||||
const oldPrivacy = video.privacy
|
const oldPrivacy = video.privacy
|
||||||
|
const isNewVideo = oldPrivacy === VideoPrivacy.PRIVATE
|
||||||
|
|
||||||
video.privacy = schedule.privacy
|
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)
|
await federateVideoIfNeeded(video, isNewVideo, t)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue