aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/regenerate-thumbnails.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-04-08 11:23:45 +0200
committerChocobozzz <me@florianbigard.com>2021-04-08 13:38:04 +0200
commit84531547bc0934a2abda586d539f7455b455d488 (patch)
tree128bf5f3a7f57e4e2f343d5da574a4e002163736 /scripts/regenerate-thumbnails.ts
parenta0eeb45f14bab539f505861cad8f5d42d9ba30cb (diff)
downloadPeerTube-84531547bc0934a2abda586d539f7455b455d488.tar.gz
PeerTube-84531547bc0934a2abda586d539f7455b455d488.tar.zst
PeerTube-84531547bc0934a2abda586d539f7455b455d488.zip
Add size info in db for actor images
Diffstat (limited to 'scripts/regenerate-thumbnails.ts')
-rw-r--r--scripts/regenerate-thumbnails.ts5
1 files changed, 2 insertions, 3 deletions
diff --git a/scripts/regenerate-thumbnails.ts b/scripts/regenerate-thumbnails.ts
index 0213b8a22..b95343c0b 100644
--- a/scripts/regenerate-thumbnails.ts
+++ b/scripts/regenerate-thumbnails.ts
@@ -4,12 +4,11 @@ registerTSPaths()
4import * as Bluebird from 'bluebird' 4import * as Bluebird from 'bluebird'
5import * as program from 'commander' 5import * as program from 'commander'
6import { pathExists, remove } from 'fs-extra' 6import { pathExists, remove } from 'fs-extra'
7import { 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' 10import { MVideo } from '@server/types/models'
11import { initDatabaseModels } from '@server/initializers/database' 11import { initDatabaseModels } from '@server/initializers/database'
12import { ActorImageModel } from '@server/models/account/actor-image'
13 12
14program 13program
15 .description('Regenerate local thumbnails using preview files') 14 .description('Regenerate local thumbnails using preview files')
@@ -52,7 +51,7 @@ async function processVideo (videoArg: MVideo) {
52 const oldPath = thumbnail.getPath() 51 const oldPath = thumbnail.getPath()
53 52
54 // Update thumbnail 53 // Update thumbnail
55 thumbnail.filename = ActorImageModel.generateFilename() 54 thumbnail.filename = generateImageFilename()
56 thumbnail.width = size.width 55 thumbnail.width = size.width
57 thumbnail.height = size.height 56 thumbnail.height = size.height
58 57