diff options
author | Chocobozzz <me@florianbigard.com> | 2021-08-18 09:14:51 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-08-18 09:14:51 +0200 |
commit | 1f6125be8b6306ba34b5ad9df985df462ef9759c (patch) | |
tree | 9894ab5a6b239f7797303c24f21e79019b942238 /scripts | |
parent | 9df52d660feb722404be00a50f3c8a612bec1c15 (diff) | |
download | PeerTube-1f6125be8b6306ba34b5ad9df985df462ef9759c.tar.gz PeerTube-1f6125be8b6306ba34b5ad9df985df462ef9759c.tar.zst PeerTube-1f6125be8b6306ba34b5ad9df985df462ef9759c.zip |
Optimize torrent URL update
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/update-host.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/update-host.ts b/scripts/update-host.ts index 9e8dd41ca..5d81a8d74 100755 --- a/scripts/update-host.ts +++ b/scripts/update-host.ts | |||
@@ -17,7 +17,7 @@ import { VideoCommentModel } from '../server/models/video/video-comment' | |||
17 | import { AccountModel } from '../server/models/account/account' | 17 | import { AccountModel } from '../server/models/account/account' |
18 | import { VideoChannelModel } from '../server/models/video/video-channel' | 18 | import { VideoChannelModel } from '../server/models/video/video-channel' |
19 | import { initDatabaseModels } from '../server/initializers/database' | 19 | import { initDatabaseModels } from '../server/initializers/database' |
20 | import { createTorrentAndSetInfoHash } from '@server/helpers/webtorrent' | 20 | import { updateTorrentUrls } from '@server/helpers/webtorrent' |
21 | import { getServerActor } from '@server/models/application/application' | 21 | import { getServerActor } from '@server/models/application/application' |
22 | 22 | ||
23 | run() | 23 | run() |
@@ -126,7 +126,7 @@ async function run () { | |||
126 | 126 | ||
127 | for (const file of video.VideoFiles) { | 127 | for (const file of video.VideoFiles) { |
128 | console.log('Updating torrent file %s of video %s.', file.resolution, video.uuid) | 128 | console.log('Updating torrent file %s of video %s.', file.resolution, video.uuid) |
129 | await createTorrentAndSetInfoHash(video, file) | 129 | await updateTorrentUrls(video, file) |
130 | 130 | ||
131 | await file.save() | 131 | await file.save() |
132 | } | 132 | } |
@@ -135,7 +135,7 @@ async function run () { | |||
135 | for (const file of (playlist?.VideoFiles || [])) { | 135 | for (const file of (playlist?.VideoFiles || [])) { |
136 | console.log('Updating fragmented torrent file %s of video %s.', file.resolution, video.uuid) | 136 | console.log('Updating fragmented torrent file %s of video %s.', file.resolution, video.uuid) |
137 | 137 | ||
138 | await createTorrentAndSetInfoHash(video, file) | 138 | await updateTorrentUrls(video, file) |
139 | 139 | ||
140 | await file.save() | 140 | await file.save() |
141 | } | 141 | } |