+ for (const comment of videoComments) {
+ if (comment.isOwned() === false) continue
+
+ console.log('Updating comment ' + comment.url)
+
+ comment.url = getVideoCommentActivityPubUrl(comment.Video, comment)
+ await comment.save()
+ }
+
+ console.log('Updating video and torrent files.')
+
+ const videos = await VideoModel.list()
+ for (const video of videos) {
+ if (video.isOwned() === false) continue
+
+ console.log('Updated video ' + video.uuid)
+
+ video.url = getVideoActivityPubUrl(video)
+ await video.save()
+
+ for (const file of video.VideoFiles) {
+ console.log('Updating torrent file %s of video %s.', file.resolution, video.uuid)
+ await video.createTorrentAndSetInfoHash(file)
+ }
+ }
+}