1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-06 03:50:26 +02:00

Add priority to transcoding jobs

(1 = highest priority)

100 for new resolutions
10 for original file optimization

Add a malus for transcoding jobs depending on how many uploads the user did in the
last 7 days
This commit is contained in:
Chocobozzz 2021-01-21 16:57:21 +01:00 committed by Chocobozzz
parent 92c871b405
commit 77d7e851dc
15 changed files with 172 additions and 79 deletions

View file

@ -3,6 +3,7 @@ import { copy, stat } from 'fs-extra'
import { extname } from 'path'
import { createTorrentAndSetInfoHash } from '@server/helpers/webtorrent'
import { getVideoFilePath } from '@server/lib/video-paths'
import { UserModel } from '@server/models/account/user'
import { MVideoFile, MVideoWithFile } from '@server/types/models'
import { VideoFileImportPayload } from '@shared/models'
import { getVideoFileFPS, getVideoFileResolution } from '../../../helpers/ffprobe-utils'
@ -24,7 +25,9 @@ async function processVideoFileImport (job: Bull.Job) {
await updateVideoFile(video, payload.filePath)
await onNewWebTorrentFileResolution(video)
const user = await UserModel.loadByChannelActorId(video.VideoChannel.actorId)
await onNewWebTorrentFileResolution(video, user)
return video
}