diff options
author | Chocobozzz <me@florianbigard.com> | 2021-04-08 11:23:45 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-04-08 13:38:04 +0200 |
commit | 84531547bc0934a2abda586d539f7455b455d488 (patch) | |
tree | 128bf5f3a7f57e4e2f343d5da574a4e002163736 /scripts | |
parent | a0eeb45f14bab539f505861cad8f5d42d9ba30cb (diff) | |
download | PeerTube-84531547bc0934a2abda586d539f7455b455d488.tar.gz PeerTube-84531547bc0934a2abda586d539f7455b455d488.tar.zst PeerTube-84531547bc0934a2abda586d539f7455b455d488.zip |
Add size info in db for actor images
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/regenerate-thumbnails.ts | 5 |
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() | |||
4 | import * as Bluebird from 'bluebird' | 4 | import * as Bluebird from 'bluebird' |
5 | import * as program from 'commander' | 5 | import * as program from 'commander' |
6 | import { pathExists, remove } from 'fs-extra' | 6 | import { pathExists, remove } from 'fs-extra' |
7 | import { processImage } from '@server/helpers/image-utils' | 7 | import { generateImageFilename, processImage } from '@server/helpers/image-utils' |
8 | import { THUMBNAILS_SIZE } from '@server/initializers/constants' | 8 | import { THUMBNAILS_SIZE } from '@server/initializers/constants' |
9 | import { VideoModel } from '@server/models/video/video' | 9 | import { VideoModel } from '@server/models/video/video' |
10 | import { MVideo } from '@server/types/models' | 10 | import { MVideo } from '@server/types/models' |
11 | import { initDatabaseModels } from '@server/initializers/database' | 11 | import { initDatabaseModels } from '@server/initializers/database' |
12 | import { ActorImageModel } from '@server/models/account/actor-image' | ||
13 | 12 | ||
14 | program | 13 | program |
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 | ||