1
0
Fork 0

#5618 - added configuration fields for Thumbnails and Previews, if no config is provided, the previous, default values are configured

This commit is contained in:
Gergo Bogdan 2024-05-29 15:56:46 +02:00 committed by Chocobozzz
parent 5e01c9c9a7
commit 3fbe849183
No known key found for this signature in database
GPG key ID: 583A612D890159BE
3 changed files with 28 additions and 6 deletions

View file

@ -469,6 +469,16 @@ thumbnails:
# Increasing this value will increase CPU and memory usage when generating the thumbnail, especially for high video resolution
# Minimum value is 2
frames_to_analyze: 50
size:
width: 280
height: 157
min_width: 150
previews:
size:
width: 850
height: 480
min_width: 400
stats:
# Display registration requests stats (average response time, total requests...)

View file

@ -371,6 +371,18 @@ const CONFIG = {
THUMBNAILS: {
GENERATION_FROM_VIDEO: {
FRAMES_TO_ANALYZE: config.get<number>('thumbnails.generation_from_video.frames_to_analyze')
},
SIZE: {
WIDTH: config.get<number>('thumbnails.size.width'),
HEIGHT: config.get<number>('thumbnails.size.height'),
MIN_WIDTH: config.get<number>('thumbnails.size.min_width'),
}
},
PREVIEWS: {
SIZE: {
WIDTH: config.get<number>('previews.size.width'),
HEIGHT: config.get<number>('previews.size.height'),
MIN_WIDTH: config.get<number>('previews.size.min_width'),
}
},
STATS: {

View file

@ -903,14 +903,14 @@ const STATIC_MAX_AGE = {
// Videos thumbnail size
const THUMBNAILS_SIZE = {
width: 280,
height: 157,
minWidth: 150
width: CONFIG.THUMBNAILS.SIZE.WIDTH || 280,
height: CONFIG.THUMBNAILS.SIZE.HEIGHT || 157,
minWidth: CONFIG.THUMBNAILS.SIZE.MIN_WIDTH || 150
}
const PREVIEWS_SIZE = {
width: 850,
height: 480,
minWidth: 400
width: CONFIG.PREVIEWS.SIZE.WIDTH || 850,
height: CONFIG.PREVIEWS.SIZE.HEIGHT || 480,
minWidth: CONFIG.PREVIEWS.SIZE.MIN_WIDTH || 400
}
const ACTOR_IMAGES_SIZE: { [key in ActorImageType_Type]: { width: number, height: number }[] } = {
[ActorImageType.AVATAR]: [ // 1/1 ratio