diff options
author | Chocobozzz <me@florianbigard.com> | 2018-06-07 09:43:18 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-06-07 09:43:18 +0200 |
commit | 28be89161aab245526d64f6fb7dd29391a97fe0a (patch) | |
tree | 1ee8bece60eea295f218cb5936141848f3a470fc /server/lib | |
parent | 0138af9237b77dd7d3a49260d164193b4048de84 (diff) | |
download | PeerTube-28be89161aab245526d64f6fb7dd29391a97fe0a.tar.gz PeerTube-28be89161aab245526d64f6fb7dd29391a97fe0a.tar.zst PeerTube-28be89161aab245526d64f6fb7dd29391a97fe0a.zip |
Improve create import file job
Fix federation of .ogv videos
Diffstat (limited to 'server/lib')
-rw-r--r-- | server/lib/job-queue/handlers/video-file.ts | 10 | ||||
-rw-r--r-- | server/lib/job-queue/job-queue.ts | 6 |
2 files changed, 8 insertions, 8 deletions
diff --git a/server/lib/job-queue/handlers/video-file.ts b/server/lib/job-queue/handlers/video-file.ts index 38eb3511c..a6fce4279 100644 --- a/server/lib/job-queue/handlers/video-file.ts +++ b/server/lib/job-queue/handlers/video-file.ts | |||
@@ -16,14 +16,14 @@ export type VideoFilePayload = { | |||
16 | isPortraitMode?: boolean | 16 | isPortraitMode?: boolean |
17 | } | 17 | } |
18 | 18 | ||
19 | export type VideoImportPayload = { | 19 | export type VideoFileImportPayload = { |
20 | videoUUID: string, | 20 | videoUUID: string, |
21 | filePath: string | 21 | filePath: string |
22 | } | 22 | } |
23 | 23 | ||
24 | async function processVideoImport (job: kue.Job) { | 24 | async function processVideoFileImport (job: kue.Job) { |
25 | const payload = job.data as VideoImportPayload | 25 | const payload = job.data as VideoFileImportPayload |
26 | logger.info('Processing video import in job %d.', job.id) | 26 | logger.info('Processing video file import in job %d.', job.id) |
27 | 27 | ||
28 | const video = await VideoModel.loadByUUIDAndPopulateAccountAndServerAndTags(payload.videoUUID) | 28 | const video = await VideoModel.loadByUUIDAndPopulateAccountAndServerAndTags(payload.videoUUID) |
29 | // No video, maybe deleted? | 29 | // No video, maybe deleted? |
@@ -132,5 +132,5 @@ async function onVideoFileOptimizerSuccess (video: VideoModel, isNewVideo: boole | |||
132 | 132 | ||
133 | export { | 133 | export { |
134 | processVideoFile, | 134 | processVideoFile, |
135 | processVideoImport | 135 | processVideoFileImport |
136 | } | 136 | } |
diff --git a/server/lib/job-queue/job-queue.ts b/server/lib/job-queue/job-queue.ts index 69335acf0..bdfa19b61 100644 --- a/server/lib/job-queue/job-queue.ts +++ b/server/lib/job-queue/job-queue.ts | |||
@@ -7,7 +7,7 @@ import { ActivitypubHttpBroadcastPayload, processActivityPubHttpBroadcast } from | |||
7 | import { ActivitypubHttpFetcherPayload, processActivityPubHttpFetcher } from './handlers/activitypub-http-fetcher' | 7 | import { ActivitypubHttpFetcherPayload, processActivityPubHttpFetcher } from './handlers/activitypub-http-fetcher' |
8 | import { ActivitypubHttpUnicastPayload, processActivityPubHttpUnicast } from './handlers/activitypub-http-unicast' | 8 | import { ActivitypubHttpUnicastPayload, processActivityPubHttpUnicast } from './handlers/activitypub-http-unicast' |
9 | import { EmailPayload, processEmail } from './handlers/email' | 9 | import { EmailPayload, processEmail } from './handlers/email' |
10 | import { processVideoFile, processVideoImport, VideoFilePayload, VideoImportPayload } from './handlers/video-file' | 10 | import { processVideoFile, processVideoFileImport, VideoFilePayload, VideoFileImportPayload } from './handlers/video-file' |
11 | import { ActivitypubFollowPayload, processActivityPubFollow } from './handlers/activitypub-follow' | 11 | import { ActivitypubFollowPayload, processActivityPubFollow } from './handlers/activitypub-follow' |
12 | 12 | ||
13 | type CreateJobArgument = | 13 | type CreateJobArgument = |
@@ -15,7 +15,7 @@ type CreateJobArgument = | |||
15 | { type: 'activitypub-http-unicast', payload: ActivitypubHttpUnicastPayload } | | 15 | { type: 'activitypub-http-unicast', payload: ActivitypubHttpUnicastPayload } | |
16 | { type: 'activitypub-http-fetcher', payload: ActivitypubHttpFetcherPayload } | | 16 | { type: 'activitypub-http-fetcher', payload: ActivitypubHttpFetcherPayload } | |
17 | { type: 'activitypub-follow', payload: ActivitypubFollowPayload } | | 17 | { type: 'activitypub-follow', payload: ActivitypubFollowPayload } | |
18 | { type: 'video-file-import', payload: VideoImportPayload } | | 18 | { type: 'video-file-import', payload: VideoFileImportPayload } | |
19 | { type: 'video-file', payload: VideoFilePayload } | | 19 | { type: 'video-file', payload: VideoFilePayload } | |
20 | { type: 'email', payload: EmailPayload } | 20 | { type: 'email', payload: EmailPayload } |
21 | 21 | ||
@@ -24,7 +24,7 @@ const handlers: { [ id in JobType ]: (job: kue.Job) => Promise<any>} = { | |||
24 | 'activitypub-http-unicast': processActivityPubHttpUnicast, | 24 | 'activitypub-http-unicast': processActivityPubHttpUnicast, |
25 | 'activitypub-http-fetcher': processActivityPubHttpFetcher, | 25 | 'activitypub-http-fetcher': processActivityPubHttpFetcher, |
26 | 'activitypub-follow': processActivityPubFollow, | 26 | 'activitypub-follow': processActivityPubFollow, |
27 | 'video-file-import': processVideoImport, | 27 | 'video-file-import': processVideoFileImport, |
28 | 'video-file': processVideoFile, | 28 | 'video-file': processVideoFile, |
29 | 'email': processEmail | 29 | 'email': processEmail |
30 | } | 30 | } |