aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/transcoding/shared/job-builders/abstract-job-builder.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/transcoding/shared/job-builders/abstract-job-builder.ts')
-rw-r--r--server/lib/transcoding/shared/job-builders/abstract-job-builder.ts18
1 files changed, 0 insertions, 18 deletions
diff --git a/server/lib/transcoding/shared/job-builders/abstract-job-builder.ts b/server/lib/transcoding/shared/job-builders/abstract-job-builder.ts
index 576e786d5..80dc05bfb 100644
--- a/server/lib/transcoding/shared/job-builders/abstract-job-builder.ts
+++ b/server/lib/transcoding/shared/job-builders/abstract-job-builder.ts
@@ -1,6 +1,4 @@
1 1
2import { JOB_PRIORITY } from '@server/initializers/constants'
3import { VideoModel } from '@server/models/video/video'
4import { MUserId, MVideoFile, MVideoFullLight } from '@server/types/models' 2import { MUserId, MVideoFile, MVideoFullLight } from '@server/types/models'
5 3
6export abstract class AbstractJobBuilder { 4export abstract class AbstractJobBuilder {
@@ -20,20 +18,4 @@ export abstract class AbstractJobBuilder {
20 isNewVideo: boolean 18 isNewVideo: boolean
21 user: MUserId | null 19 user: MUserId | null
22 }): Promise<any> 20 }): Promise<any>
23
24 protected async getTranscodingJobPriority (options: {
25 user: MUserId
26 fallback: number
27 }) {
28 const { user, fallback } = options
29
30 if (!user) return fallback
31
32 const now = new Date()
33 const lastWeek = new Date(now.getFullYear(), now.getMonth(), now.getDate() - 7)
34
35 const videoUploadedByUser = await VideoModel.countVideosUploadedByUserSince(user.id, lastWeek)
36
37 return JOB_PRIORITY.TRANSCODING + videoUploadedByUser
38 }
39} 21}