diff options
Diffstat (limited to 'scripts/update-host.ts')
-rwxr-xr-x | scripts/update-host.ts | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/scripts/update-host.ts b/scripts/update-host.ts index b030b21c3..d0a1b03cc 100755 --- a/scripts/update-host.ts +++ b/scripts/update-host.ts | |||
@@ -116,8 +116,10 @@ async function run () { | |||
116 | 116 | ||
117 | console.log('Updating video and torrent files.') | 117 | console.log('Updating video and torrent files.') |
118 | 118 | ||
119 | const videos = await VideoModel.listLocal() | 119 | const localVideos = await VideoModel.listLocal() |
120 | for (const video of videos) { | 120 | for (const localVideo of localVideos) { |
121 | const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(localVideo.id) | ||
122 | |||
121 | console.log('Updating video ' + video.uuid) | 123 | console.log('Updating video ' + video.uuid) |
122 | 124 | ||
123 | video.url = getLocalVideoActivityPubUrl(video) | 125 | video.url = getLocalVideoActivityPubUrl(video) |
@@ -125,7 +127,7 @@ async function run () { | |||
125 | 127 | ||
126 | for (const file of video.VideoFiles) { | 128 | for (const file of video.VideoFiles) { |
127 | console.log('Updating torrent file %s of video %s.', file.resolution, video.uuid) | 129 | console.log('Updating torrent file %s of video %s.', file.resolution, video.uuid) |
128 | await createTorrentAndSetInfoHash(video, file) | 130 | await createTorrentAndSetInfoHash(video, video, file) |
129 | } | 131 | } |
130 | 132 | ||
131 | for (const playlist of video.VideoStreamingPlaylists) { | 133 | for (const playlist of video.VideoStreamingPlaylists) { |