diff options
Diffstat (limited to 'server/lib/activitypub/process/process-update.ts')
-rw-r--r-- | server/lib/activitypub/process/process-update.ts | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/server/lib/activitypub/process/process-update.ts b/server/lib/activitypub/process/process-update.ts index c0038be64..c7ad412bc 100644 --- a/server/lib/activitypub/process/process-update.ts +++ b/server/lib/activitypub/process/process-update.ts | |||
@@ -11,7 +11,10 @@ import { ActorModel } from '../../../models/activitypub/actor' | |||
11 | import { TagModel } from '../../../models/video/tag' | 11 | import { TagModel } from '../../../models/video/tag' |
12 | import { VideoFileModel } from '../../../models/video/video-file' | 12 | import { VideoFileModel } from '../../../models/video/video-file' |
13 | import { fetchAvatarIfExists, getOrCreateActorAndServerAndModel, updateActorAvatarInstance, updateActorInstance } from '../actor' | 13 | import { fetchAvatarIfExists, getOrCreateActorAndServerAndModel, updateActorAvatarInstance, updateActorInstance } from '../actor' |
14 | import { getOrCreateAccountAndVideoAndChannel, videoActivityObjectToDBAttributes, videoFileActivityUrlToDBAttributes } from '../videos' | 14 | import { |
15 | generateThumbnailFromUrl, getOrCreateAccountAndVideoAndChannel, videoActivityObjectToDBAttributes, | ||
16 | videoFileActivityUrlToDBAttributes | ||
17 | } from '../videos' | ||
15 | 18 | ||
16 | async function processUpdateActivity (activity: ActivityUpdate) { | 19 | async function processUpdateActivity (activity: ActivityUpdate) { |
17 | const actor = await getOrCreateActorAndServerAndModel(activity.actor) | 20 | const actor = await getOrCreateActorAndServerAndModel(activity.actor) |
@@ -82,6 +85,10 @@ async function updateRemoteVideo (actor: ActorModel, activity: ActivityUpdate) { | |||
82 | 85 | ||
83 | await videoInstance.save(sequelizeOptions) | 86 | await videoInstance.save(sequelizeOptions) |
84 | 87 | ||
88 | // Don't block on request | ||
89 | generateThumbnailFromUrl(videoInstance, videoAttributesToUpdate.icon) | ||
90 | .catch(err => logger.warn('Cannot generate thumbnail of %s.', videoAttributesToUpdate.id, err)) | ||
91 | |||
85 | // Remove old video files | 92 | // Remove old video files |
86 | const videoFileDestroyTasks: Bluebird<void>[] = [] | 93 | const videoFileDestroyTasks: Bluebird<void>[] = [] |
87 | for (const videoFile of videoInstance.VideoFiles) { | 94 | for (const videoFile of videoInstance.VideoFiles) { |