X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=scripts%2Fupdate-host.ts;h=59268422502c654876ec33f262410c9ea5423129;hb=a92ddacb38a4a17e117ca9ed41680a03580fb81d;hp=b030b21c313694858a069f53dbfdb55b2cc82af7;hpb=de94ac86a211dec657332d964693857ec235ce40;p=github%2FChocobozzz%2FPeerTube.git diff --git a/scripts/update-host.ts b/scripts/update-host.ts index b030b21c3..592684225 100755 --- a/scripts/update-host.ts +++ b/scripts/update-host.ts @@ -2,9 +2,9 @@ import { registerTSPaths } from '../server/helpers/register-ts-paths' registerTSPaths() import { WEBSERVER } from '../server/initializers/constants' -import { ActorFollowModel } from '../server/models/activitypub/actor-follow' +import { ActorFollowModel } from '../server/models/actor/actor-follow' import { VideoModel } from '../server/models/video/video' -import { ActorModel } from '../server/models/activitypub/actor' +import { ActorModel } from '../server/models/actor/actor' import { getLocalAccountActivityPubUrl, getLocalVideoActivityPubUrl, @@ -116,8 +116,10 @@ async function run () { console.log('Updating video and torrent files.') - const videos = await VideoModel.listLocal() - for (const video of videos) { + const localVideos = await VideoModel.listLocal() + for (const localVideo of localVideos) { + const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(localVideo.id) + console.log('Updating video ' + video.uuid) video.url = getLocalVideoActivityPubUrl(video)