]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/models/server/job.model.ts
Add ability to update torrents cache in client
[github/Chocobozzz/PeerTube.git] / shared / models / server / job.model.ts
index 346b25607624158bc8d2e5b5aab404ad8dbd12c4..07d7efe2295b1933889ec3e9f1d3fe166eaa00ee 100644 (file)
@@ -2,7 +2,7 @@ import { ContextType } from '../activitypub/context'
 import { VideoResolution } from '../videos/video-resolution.enum'
 import { SendEmailOptions } from './emailer.model'
 
-export type JobState = 'active' | 'completed' | 'failed' | 'waiting' | 'delayed'
+export type JobState = 'active' | 'completed' | 'failed' | 'waiting' | 'delayed' | 'paused'
 
 export type JobType =
   | 'activitypub-http-unicast'
@@ -23,6 +23,8 @@ export interface Job {
   state: JobState
   type: JobType
   data: any
+  priority: number
+  progress: number
   error: any
   createdAt: Date | string
   finishedOn: Date | string
@@ -78,9 +80,6 @@ export type VideoImportYoutubeDLPayload = {
   type: VideoImportYoutubeDLPayloadType
   videoImportId: number
 
-  generateThumbnail: boolean
-  generatePreview: boolean
-
   fileExt?: string
 }
 export type VideoImportTorrentPayload = {
@@ -100,26 +99,27 @@ interface BaseTranscodingPayload {
   isNewVideo?: boolean
 }
 
-interface HLSTranscodingPayload extends BaseTranscodingPayload {
-  type: 'hls'
+export interface HLSTranscodingPayload extends BaseTranscodingPayload {
+  type: 'new-resolution-to-hls'
   isPortraitMode?: boolean
   resolution: VideoResolution
   copyCodecs: boolean
+  isMaxQuality: boolean
 }
 
 export interface NewResolutionTranscodingPayload extends BaseTranscodingPayload {
-  type: 'new-resolution'
+  type: 'new-resolution-to-webtorrent'
   isPortraitMode?: boolean
   resolution: VideoResolution
 }
 
 export interface MergeAudioTranscodingPayload extends BaseTranscodingPayload {
-  type: 'merge-audio'
+  type: 'merge-audio-to-webtorrent'
   resolution: VideoResolution
 }
 
 export interface OptimizeTranscodingPayload extends BaseTranscodingPayload {
-  type: 'optimize'
+  type: 'optimize-to-webtorrent'
 }
 
 export type VideoTranscodingPayload =