+ for (const actor of actors) {
+ if (actor.isOwned() === false) continue
+
+ console.log('Updating actor ' + actor.url)
+
+ const newUrl = actor.Account
+ ? getLocalAccountActivityPubUrl(actor.preferredUsername)
+ : getLocalVideoChannelActivityPubUrl(actor.preferredUsername)
+
+ actor.url = newUrl
+ actor.inboxUrl = newUrl + '/inbox'
+ actor.outboxUrl = newUrl + '/outbox'
+ actor.sharedInboxUrl = WEBSERVER.URL + '/inbox'
+ actor.followersUrl = newUrl + '/followers'
+ actor.followingUrl = newUrl + '/following'
+
+ await actor.save()
+ }
+
+ console.log('Updating video shares.')
+
+ const videoShares: VideoShareModel[] = await VideoShareModel.findAll({
+ include: [ VideoModel.unscoped(), ActorModel.unscoped() ]
+ })
+ for (const videoShare of videoShares) {
+ if (videoShare.Video.isOwned() === false) continue
+
+ console.log('Updating video share ' + videoShare.url)
+
+ videoShare.url = getLocalVideoAnnounceActivityPubUrl(videoShare.Actor, videoShare.Video)
+ await videoShare.save()
+ }
+
+ console.log('Updating video comments.')
+ const videoComments: VideoCommentModel[] = await VideoCommentModel.findAll({
+ include: [
+ {
+ model: VideoModel.unscoped()
+ },
+ {
+ model: AccountModel.unscoped(),
+ include: [
+ {
+ model: ActorModel.unscoped()
+ }
+ ]
+ }
+ ]