aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/regenerate-thumbnails.ts
diff options
context:
space:
mode:
authorkontrollanten <6680299+kontrollanten@users.noreply.github.com>2021-11-09 11:05:35 +0100
committerGitHub <noreply@github.com>2021-11-09 11:05:35 +0100
commite1ab52d7ec7370a6f9f5937192d6003206af1ac0 (patch)
treeaecc8b696b0021e073fd205dd6e126fb4f178e8f /scripts/regenerate-thumbnails.ts
parentc49c366ac320fe5ac3dc08f5891fe5898c1b34e3 (diff)
downloadPeerTube-e1ab52d7ec7370a6f9f5937192d6003206af1ac0.tar.gz
PeerTube-e1ab52d7ec7370a6f9f5937192d6003206af1ac0.tar.zst
PeerTube-e1ab52d7ec7370a6f9f5937192d6003206af1ac0.zip
Add migrate-to-object-storage script (#4481)
* add migrate-to-object-storage-script closes #4467 * add migrate-to-unique-playlist-filenames script * fix(migrate-to-unique-playlist-filenames): update master/segments256 run updateMasterHLSPlaylist and updateSha256VODSegments after file rename. * Improve move to object storage scripts * PR remarks Co-authored-by: Chocobozzz <me@florianbigard.com>
Diffstat (limited to 'scripts/regenerate-thumbnails.ts')
-rw-r--r--scripts/regenerate-thumbnails.ts13
1 files changed, 6 insertions, 7 deletions
diff --git a/scripts/regenerate-thumbnails.ts b/scripts/regenerate-thumbnails.ts
index 8075f90ba..50d06f6fd 100644
--- a/scripts/regenerate-thumbnails.ts
+++ b/scripts/regenerate-thumbnails.ts
@@ -7,7 +7,6 @@ import { pathExists, remove } from 'fs-extra'
7import { generateImageFilename, processImage } from '@server/helpers/image-utils' 7import { generateImageFilename, processImage } from '@server/helpers/image-utils'
8import { THUMBNAILS_SIZE } from '@server/initializers/constants' 8import { THUMBNAILS_SIZE } from '@server/initializers/constants'
9import { VideoModel } from '@server/models/video/video' 9import { VideoModel } from '@server/models/video/video'
10import { MVideo } from '@server/types/models'
11import { initDatabaseModels } from '@server/initializers/database' 10import { initDatabaseModels } from '@server/initializers/database'
12 11
13program 12program
@@ -21,16 +20,16 @@ run()
21async function run () { 20async function run () {
22 await initDatabaseModels(true) 21 await initDatabaseModels(true)
23 22
24 const videos = await VideoModel.listLocal() 23 const ids = await VideoModel.listLocalIds()
25 24
26 await map(videos, v => { 25 await map(ids, id => {
27 return processVideo(v) 26 return processVideo(id)
28 .catch(err => console.error('Cannot process video %s.', v.url, err)) 27 .catch(err => console.error('Cannot process video %d.', id, err))
29 }, { concurrency: 20 }) 28 }, { concurrency: 20 })
30} 29}
31 30
32async function processVideo (videoArg: MVideo) { 31async function processVideo (id: number) {
33 const video = await VideoModel.loadWithFiles(videoArg.id) 32 const video = await VideoModel.loadWithFiles(id)
34 33
35 console.log('Processing video %s.', video.name) 34 console.log('Processing video %s.', video.name)
36 35