aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/optimize-old-videos.ts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/optimize-old-videos.ts')
-rw-r--r--scripts/optimize-old-videos.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/optimize-old-videos.ts b/scripts/optimize-old-videos.ts
index d5696de67..8e2e7fcf4 100644
--- a/scripts/optimize-old-videos.ts
+++ b/scripts/optimize-old-videos.ts
@@ -34,7 +34,9 @@ async function run () {
34 34
35 const localVideos = await VideoModel.listLocal() 35 const localVideos = await VideoModel.listLocal()
36 36
37 for (const video of localVideos) { 37 for (const localVideo of localVideos) {
38 const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(localVideo.id)
39
38 currentVideoId = video.id 40 currentVideoId = video.id
39 41
40 for (const file of video.VideoFiles) { 42 for (const file of video.VideoFiles) {
@@ -70,7 +72,7 @@ async function run () {
70 72
71 console.log('Failed to optimize %s, restoring original', basename(currentFile)) 73 console.log('Failed to optimize %s, restoring original', basename(currentFile))
72 await move(backupFile, currentFile, { overwrite: true }) 74 await move(backupFile, currentFile, { overwrite: true })
73 await createTorrentAndSetInfoHash(video, file) 75 await createTorrentAndSetInfoHash(video, video, file)
74 await file.save() 76 await file.save()
75 } 77 }
76 } 78 }