}
if (syncParam.refreshVideo === true) videoFromDatabase = await refreshVideoIfNeeded(refreshOptions)
- else await JobQueue.Instance.createJob({ type: 'activitypub-refresher', payload: { type: 'video', videoUrl: videoFromDatabase.url } })
+ else await JobQueue.Instance.createJob({ type: 'activitypub-refresher', payload: { type: 'video', url: videoFromDatabase.url } })
}
return { video: videoFromDatabase, created: false }
overrideTo?: string[]
}) {
logger.debug('Updating remote video "%s".', options.videoObject.uuid)
+
let videoFieldsSave: any
+ const wasPrivateVideo = options.video.privacy === VideoPrivacy.PRIVATE
+ const wasUnlistedVideo = options.video.privacy === VideoPrivacy.UNLISTED
try {
await sequelizeTypescript.transaction(async t => {
- const sequelizeOptions = {
- transaction: t
- }
+ const sequelizeOptions = { transaction: t }
videoFieldsSave = options.video.toJSON()
- const wasPrivateVideo = options.video.privacy === VideoPrivacy.PRIVATE
- const wasUnlistedVideo = options.video.privacy === VideoPrivacy.UNLISTED
-
// Check actor has the right to update the video
const videoChannel = options.video.VideoChannel
if (videoChannel.Account.id !== options.account.id) {
})
options.video.VideoCaptions = await Promise.all(videoCaptionsPromises)
}
-
- {
- // Notify our users?
- if (wasPrivateVideo || wasUnlistedVideo) {
- Notifier.Instance.notifyOnNewVideo(options.video)
- }
- }
})
+ // Notify our users?
+ if (wasPrivateVideo || wasUnlistedVideo) {
+ Notifier.Instance.notifyOnNewVideo(options.video)
+ }
+
logger.info('Remote video with uuid %s updated', options.videoObject.uuid)
} catch (err) {
if (options.video !== undefined && videoFieldsSave !== undefined) {