diff options
Diffstat (limited to 'scripts/update-host.ts')
-rwxr-xr-x | scripts/update-host.ts | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/scripts/update-host.ts b/scripts/update-host.ts index c6eb9d533..bb54290a4 100755 --- a/scripts/update-host.ts +++ b/scripts/update-host.ts | |||
@@ -1,10 +1,7 @@ | |||
1 | import { registerTSPaths } from '../server/helpers/register-ts-paths' | 1 | import { updateTorrentMetadata } from '@server/helpers/webtorrent' |
2 | registerTSPaths() | 2 | import { getServerActor } from '@server/models/application/application' |
3 | |||
4 | import { WEBSERVER } from '../server/initializers/constants' | 3 | import { WEBSERVER } from '../server/initializers/constants' |
5 | import { ActorFollowModel } from '../server/models/actor/actor-follow' | 4 | import { initDatabaseModels } from '../server/initializers/database' |
6 | import { VideoModel } from '../server/models/video/video' | ||
7 | import { ActorModel } from '../server/models/actor/actor' | ||
8 | import { | 5 | import { |
9 | getLocalAccountActivityPubUrl, | 6 | getLocalAccountActivityPubUrl, |
10 | getLocalVideoActivityPubUrl, | 7 | getLocalVideoActivityPubUrl, |
@@ -12,13 +9,13 @@ import { | |||
12 | getLocalVideoChannelActivityPubUrl, | 9 | getLocalVideoChannelActivityPubUrl, |
13 | getLocalVideoCommentActivityPubUrl | 10 | getLocalVideoCommentActivityPubUrl |
14 | } from '../server/lib/activitypub/url' | 11 | } from '../server/lib/activitypub/url' |
15 | import { VideoShareModel } from '../server/models/video/video-share' | ||
16 | import { VideoCommentModel } from '../server/models/video/video-comment' | ||
17 | import { AccountModel } from '../server/models/account/account' | 12 | import { AccountModel } from '../server/models/account/account' |
13 | import { ActorModel } from '../server/models/actor/actor' | ||
14 | import { ActorFollowModel } from '../server/models/actor/actor-follow' | ||
15 | import { VideoModel } from '../server/models/video/video' | ||
18 | import { VideoChannelModel } from '../server/models/video/video-channel' | 16 | import { VideoChannelModel } from '../server/models/video/video-channel' |
19 | import { initDatabaseModels } from '../server/initializers/database' | 17 | import { VideoCommentModel } from '../server/models/video/video-comment' |
20 | import { updateTorrentUrls } from '@server/helpers/webtorrent' | 18 | import { VideoShareModel } from '../server/models/video/video-share' |
21 | import { getServerActor } from '@server/models/application/application' | ||
22 | 19 | ||
23 | run() | 20 | run() |
24 | .then(() => process.exit(0)) | 21 | .then(() => process.exit(0)) |
@@ -126,7 +123,7 @@ async function run () { | |||
126 | 123 | ||
127 | for (const file of video.VideoFiles) { | 124 | for (const file of video.VideoFiles) { |
128 | console.log('Updating torrent file %s of video %s.', file.resolution, video.uuid) | 125 | console.log('Updating torrent file %s of video %s.', file.resolution, video.uuid) |
129 | await updateTorrentUrls(video, file) | 126 | await updateTorrentMetadata(video, file) |
130 | 127 | ||
131 | await file.save() | 128 | await file.save() |
132 | } | 129 | } |
@@ -135,7 +132,7 @@ async function run () { | |||
135 | for (const file of (playlist?.VideoFiles || [])) { | 132 | for (const file of (playlist?.VideoFiles || [])) { |
136 | console.log('Updating fragmented torrent file %s of video %s.', file.resolution, video.uuid) | 133 | console.log('Updating fragmented torrent file %s of video %s.', file.resolution, video.uuid) |
137 | 134 | ||
138 | await updateTorrentUrls(video, file) | 135 | await updateTorrentMetadata(playlist, file) |
139 | 136 | ||
140 | await file.save() | 137 | await file.save() |
141 | } | 138 | } |