1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-03 09:49:20 +02:00

Add video aspect ratio in server

This commit is contained in:
Chocobozzz 2024-02-27 11:18:56 +01:00
parent c75381208f
commit b6b1aaa56f
No known key found for this signature in database
GPG key ID: 583A612D890159BE
52 changed files with 345 additions and 237 deletions

View file

@ -23,6 +23,7 @@ import {
replaceVideoSourceResumableValidator,
videoSourceGetLatestValidator
} from '../../../middlewares/index.js'
import { buildAspectRatio } from '@peertube/peertube-core-utils'
const lTags = loggerTagsFactory('api', 'video')
@ -96,6 +97,7 @@ async function replaceVideoSourceResumable (req: express.Request, res: express.R
video.state = buildNextVideoState()
video.duration = videoPhysicalFile.duration
video.inputFileUpdatedAt = inputFileUpdatedAt
video.aspectRatio = buildAspectRatio({ width: videoFile.width, height: videoFile.height })
await video.save({ transaction })
await autoBlacklistVideoIfNeeded({