]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - scripts/update-host.ts
Error if importing a torrent with multiple files
[github/Chocobozzz/PeerTube.git] / scripts / update-host.ts
index b030b21c313694858a069f53dbfdb55b2cc82af7..59268422502c654876ec33f262410c9ea5423129 100755 (executable)
@@ -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)