X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=scripts%2Fupdate-host.ts;h=d2fb19c76352fcf9819d049acb7b053e278115d7;hb=890666733f3f2d0f9f1f8cb89c54fee555ac5715;hp=a946d2e4229523a4f5278d6999ef8e8500588a98;hpb=2aaa1a3fdc49be77aec5309dab5507865c38d392;p=github%2FChocobozzz%2FPeerTube.git diff --git a/scripts/update-host.ts b/scripts/update-host.ts index a946d2e42..d2fb19c76 100755 --- a/scripts/update-host.ts +++ b/scripts/update-host.ts @@ -11,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)) @@ -124,12 +125,12 @@ 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) { playlist.playlistUrl = WEBSERVER.URL + VideoStreamingPlaylistModel.getHlsMasterPlaylistStaticPath(video.uuid) - playlist.segmentsSha256Url = WEBSERVER.URL + VideoStreamingPlaylistModel.getHlsSha256SegmentsStaticPath(video.uuid) + playlist.segmentsSha256Url = WEBSERVER.URL + VideoStreamingPlaylistModel.getHlsSha256SegmentsStaticPath(video.uuid, video.isLive) await playlist.save() }