diff options
Diffstat (limited to 'server/models/video')
-rw-r--r-- | server/models/video/video.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/server/models/video/video.ts b/server/models/video/video.ts index e0c4dd2db..d2daf18ee 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts | |||
@@ -1766,12 +1766,12 @@ export class VideoModel extends Model<Partial<AttributesOnly<VideoModel>>> { | |||
1766 | this.privacy === VideoPrivacy.INTERNAL | 1766 | this.privacy === VideoPrivacy.INTERNAL |
1767 | } | 1767 | } |
1768 | 1768 | ||
1769 | async setNewState (newState: VideoState, transaction: Transaction) { | 1769 | async setNewState (newState: VideoState, isNewVideo: boolean, transaction: Transaction) { |
1770 | if (this.state === newState) throw new Error('Cannot use same state ' + newState) | 1770 | if (this.state === newState) throw new Error('Cannot use same state ' + newState) |
1771 | 1771 | ||
1772 | this.state = newState | 1772 | this.state = newState |
1773 | 1773 | ||
1774 | if (this.state === VideoState.PUBLISHED) { | 1774 | if (this.state === VideoState.PUBLISHED && isNewVideo) { |
1775 | this.publishedAt = new Date() | 1775 | this.publishedAt = new Date() |
1776 | } | 1776 | } |
1777 | 1777 | ||