X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=scripts%2Fupdate-host.ts;h=2efe326a2b03cdafe95e3ee1345c95476153988d;hb=20dcfd74982f4ec8a143696abed02b059d30d9ec;hp=57919b9981a4f40bf27b48bb541d1738466aa0e1;hpb=97567dd81f508dd6295ac4d73d849aa2ce0a6549;p=github%2FChocobozzz%2FPeerTube.git diff --git a/scripts/update-host.ts b/scripts/update-host.ts index 57919b998..2efe326a2 100755 --- a/scripts/update-host.ts +++ b/scripts/update-host.ts @@ -1,3 +1,6 @@ +import { registerTSPaths } from '../server/helpers/register-ts-paths' +registerTSPaths() + import { WEBSERVER } from '../server/initializers/constants' import { ActorFollowModel } from '../server/models/activitypub/actor-follow' import { VideoModel } from '../server/models/video/video' @@ -8,14 +11,15 @@ import { getVideoAnnounceActivityPubUrl, getVideoChannelActivityPubUrl, getVideoCommentActivityPubUrl -} from '../server/lib/activitypub' +} from '../server/lib/activitypub/url' import { VideoShareModel } from '../server/models/video/video-share' import { VideoCommentModel } from '../server/models/video/video-comment' -import { getServerActor } from '../server/helpers/utils' import { AccountModel } from '../server/models/account/account' import { VideoChannelModel } from '../server/models/video/video-channel' import { VideoStreamingPlaylistModel } from '../server/models/video/video-streaming-playlist' -import { initDatabaseModels } from '../server/initializers' +import { initDatabaseModels } from '../server/initializers/database' +import { createTorrentAndSetInfoHash } from '@server/helpers/webtorrent' +import { getServerActor } from '@server/models/application/application' run() .then(() => process.exit(0)) @@ -121,7 +125,7 @@ async function run () { for (const file of video.VideoFiles) { console.log('Updating torrent file %s of video %s.', file.resolution, video.uuid) - await video.createTorrentAndSetInfoHash(file) + await createTorrentAndSetInfoHash(video, file) } for (const playlist of video.VideoStreamingPlaylists) {