+ for (const comment of videoComments) {
+ if (comment.isOwned() === false) continue
+
+ console.log('Updating comment ' + comment.url)
+
+ comment.url = getLocalVideoCommentActivityPubUrl(comment.Video, comment)
+ await comment.save()
+ }
+
+ console.log('Updating video and torrent files.')
+
+ const ids = await VideoModel.listLocalIds()
+ for (const id of ids) {
+ const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(id)
+
+ console.log('Updating video ' + video.uuid)
+
+ video.url = getLocalVideoActivityPubUrl(video)
+ await video.save()
+
+ for (const file of video.VideoFiles) {
+ console.log('Updating torrent file %s of video %s.', file.resolution, video.uuid)
+ await updateTorrentMetadata(video, file)
+
+ await file.save()
+ }
+
+ const playlist = video.getHLSPlaylist()
+ for (const file of (playlist?.VideoFiles || [])) {
+ console.log('Updating fragmented torrent file %s of video %s.', file.resolution, video.uuid)
+
+ await updateTorrentMetadata(playlist, file)
+
+ await file.save()
+ }
+ }
+}