aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/activitypub
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/activitypub')
-rw-r--r--server/lib/activitypub/videos.ts10
1 files changed, 7 insertions, 3 deletions
diff --git a/server/lib/activitypub/videos.ts b/server/lib/activitypub/videos.ts
index 3dccabe12..b1e7f20b9 100644
--- a/server/lib/activitypub/videos.ts
+++ b/server/lib/activitypub/videos.ts
@@ -370,13 +370,15 @@ async function refreshVideoIfNeeded (options: {
370 try { 370 try {
371 const { response, videoObject } = await fetchRemoteVideo(video.url) 371 const { response, videoObject } = await fetchRemoteVideo(video.url)
372 if (response.statusCode === 404) { 372 if (response.statusCode === 404) {
373 logger.info('Cannot refresh remote video %s: video does not exist anymore. Deleting it.', video.url)
374
373 // Video does not exist anymore 375 // Video does not exist anymore
374 await video.destroy() 376 await video.destroy()
375 return undefined 377 return undefined
376 } 378 }
377 379
378 if (videoObject === undefined) { 380 if (videoObject === undefined) {
379 logger.warn('Cannot refresh remote video: invalid body.') 381 logger.warn('Cannot refresh remote video %s: invalid body.', video.url)
380 return video 382 return video
381 } 383 }
382 384
@@ -390,8 +392,10 @@ async function refreshVideoIfNeeded (options: {
390 channel: channelActor.VideoChannel, 392 channel: channelActor.VideoChannel,
391 updateViews: options.refreshViews 393 updateViews: options.refreshViews
392 } 394 }
393 await retryTransactionWrapper(updateVideoFromAP, updateOptions) 395 const videoUpdated = await retryTransactionWrapper(updateVideoFromAP, updateOptions)
394 await syncVideoExternalAttributes(video, videoObject, options.syncParam) 396 await syncVideoExternalAttributes(videoUpdated, videoObject, options.syncParam)
397
398 return videoUpdated
395 } catch (err) { 399 } catch (err) {
396 logger.warn('Cannot refresh video.', { err }) 400 logger.warn('Cannot refresh video.', { err })
397 return video 401 return video