+ 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 videos = await VideoModel.listLocal()
+ for (const video of videos) {
+ 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 createTorrentAndSetInfoHash(video, file)
+ }
+
+ for (const playlist of video.VideoStreamingPlaylists) {
+ playlist.playlistUrl = WEBSERVER.URL + VideoStreamingPlaylistModel.getHlsMasterPlaylistStaticPath(video.uuid)
+ playlist.segmentsSha256Url = WEBSERVER.URL + VideoStreamingPlaylistModel.getHlsSha256SegmentsStaticPath(video.uuid, video.isLive)
+
+ await playlist.save()
+ }
+ }
+}