diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/update-host.ts | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/scripts/update-host.ts b/scripts/update-host.ts index d2fb19c76..b030b21c3 100755 --- a/scripts/update-host.ts +++ b/scripts/update-host.ts | |||
@@ -6,11 +6,11 @@ import { ActorFollowModel } from '../server/models/activitypub/actor-follow' | |||
6 | import { VideoModel } from '../server/models/video/video' | 6 | import { VideoModel } from '../server/models/video/video' |
7 | import { ActorModel } from '../server/models/activitypub/actor' | 7 | import { ActorModel } from '../server/models/activitypub/actor' |
8 | import { | 8 | import { |
9 | getAccountActivityPubUrl, | 9 | getLocalAccountActivityPubUrl, |
10 | getVideoActivityPubUrl, | 10 | getLocalVideoActivityPubUrl, |
11 | getVideoAnnounceActivityPubUrl, | 11 | getLocalVideoAnnounceActivityPubUrl, |
12 | getVideoChannelActivityPubUrl, | 12 | getLocalVideoChannelActivityPubUrl, |
13 | getVideoCommentActivityPubUrl | 13 | getLocalVideoCommentActivityPubUrl |
14 | } from '../server/lib/activitypub/url' | 14 | } from '../server/lib/activitypub/url' |
15 | import { VideoShareModel } from '../server/models/video/video-share' | 15 | import { VideoShareModel } from '../server/models/video/video-share' |
16 | import { VideoCommentModel } from '../server/models/video/video-comment' | 16 | import { VideoCommentModel } from '../server/models/video/video-comment' |
@@ -62,8 +62,8 @@ async function run () { | |||
62 | console.log('Updating actor ' + actor.url) | 62 | console.log('Updating actor ' + actor.url) |
63 | 63 | ||
64 | const newUrl = actor.Account | 64 | const newUrl = actor.Account |
65 | ? getAccountActivityPubUrl(actor.preferredUsername) | 65 | ? getLocalAccountActivityPubUrl(actor.preferredUsername) |
66 | : getVideoChannelActivityPubUrl(actor.preferredUsername) | 66 | : getLocalVideoChannelActivityPubUrl(actor.preferredUsername) |
67 | 67 | ||
68 | actor.url = newUrl | 68 | actor.url = newUrl |
69 | actor.inboxUrl = newUrl + '/inbox' | 69 | actor.inboxUrl = newUrl + '/inbox' |
@@ -85,7 +85,7 @@ async function run () { | |||
85 | 85 | ||
86 | console.log('Updating video share ' + videoShare.url) | 86 | console.log('Updating video share ' + videoShare.url) |
87 | 87 | ||
88 | videoShare.url = getVideoAnnounceActivityPubUrl(videoShare.Actor, videoShare.Video) | 88 | videoShare.url = getLocalVideoAnnounceActivityPubUrl(videoShare.Actor, videoShare.Video) |
89 | await videoShare.save() | 89 | await videoShare.save() |
90 | } | 90 | } |
91 | 91 | ||
@@ -110,7 +110,7 @@ async function run () { | |||
110 | 110 | ||
111 | console.log('Updating comment ' + comment.url) | 111 | console.log('Updating comment ' + comment.url) |
112 | 112 | ||
113 | comment.url = getVideoCommentActivityPubUrl(comment.Video, comment) | 113 | comment.url = getLocalVideoCommentActivityPubUrl(comment.Video, comment) |
114 | await comment.save() | 114 | await comment.save() |
115 | } | 115 | } |
116 | 116 | ||
@@ -120,7 +120,7 @@ async function run () { | |||
120 | for (const video of videos) { | 120 | for (const video of videos) { |
121 | console.log('Updating video ' + video.uuid) | 121 | console.log('Updating video ' + video.uuid) |
122 | 122 | ||
123 | video.url = getVideoActivityPubUrl(video) | 123 | video.url = getLocalVideoActivityPubUrl(video) |
124 | await video.save() | 124 | await video.save() |
125 | 125 | ||
126 | for (const file of video.VideoFiles) { | 126 | for (const file of video.VideoFiles) { |