projects
/
oweals
/
peertube.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
98d3324
)
Fix publishedAt after a scheduled update
author
Chocobozzz
<me@florianbigard.com>
Tue, 24 Jul 2018 13:11:28 +0000
(15:11 +0200)
committer
Chocobozzz
<me@florianbigard.com>
Tue, 24 Jul 2018 13:11:28 +0000
(15:11 +0200)
server/lib/schedulers/update-videos-scheduler.ts
patch
|
blob
|
history
diff --git
a/server/lib/schedulers/update-videos-scheduler.ts
b/server/lib/schedulers/update-videos-scheduler.ts
index 760475af9bbc545d2e60d3bb5b710f87f83aef91..fd2edfd1702007665ce8cf03279db14194547c30 100644
(file)
--- a/
server/lib/schedulers/update-videos-scheduler.ts
+++ b/
server/lib/schedulers/update-videos-scheduler.ts
@@
-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)
}