diff options
Diffstat (limited to 'server/lib')
-rw-r--r-- | server/lib/cache/videos-preview-cache.ts | 2 | ||||
-rw-r--r-- | server/lib/jobs/transcoding-job-scheduler/video-file-optimizer-handler.ts | 4 | ||||
-rw-r--r-- | server/lib/jobs/transcoding-job-scheduler/video-file-transcoder-handler.ts | 4 | ||||
-rw-r--r-- | server/lib/user.ts | 2 | ||||
-rw-r--r-- | server/lib/video-channel.ts | 6 |
5 files changed, 9 insertions, 9 deletions
diff --git a/server/lib/cache/videos-preview-cache.ts b/server/lib/cache/videos-preview-cache.ts index 776f647a0..0570f51e8 100644 --- a/server/lib/cache/videos-preview-cache.ts +++ b/server/lib/cache/videos-preview-cache.ts | |||
@@ -42,7 +42,7 @@ class VideosPreviewCache { | |||
42 | } | 42 | } |
43 | 43 | ||
44 | private async loadPreviews (key: string) { | 44 | private async loadPreviews (key: string) { |
45 | const video = await db.Video.loadByUUIDAndPopulateAccountAndPodAndTags(key) | 45 | const video = await db.Video.loadByUUIDAndPopulateAccountAndServerAndTags(key) |
46 | if (!video) return undefined | 46 | if (!video) return undefined |
47 | 47 | ||
48 | if (video.isOwned()) return join(CONFIG.STORAGE.PREVIEWS_DIR, video.getPreviewName()) | 48 | if (video.isOwned()) return join(CONFIG.STORAGE.PREVIEWS_DIR, video.getPreviewName()) |
diff --git a/server/lib/jobs/transcoding-job-scheduler/video-file-optimizer-handler.ts b/server/lib/jobs/transcoding-job-scheduler/video-file-optimizer-handler.ts index 47603a66c..d3ee886e7 100644 --- a/server/lib/jobs/transcoding-job-scheduler/video-file-optimizer-handler.ts +++ b/server/lib/jobs/transcoding-job-scheduler/video-file-optimizer-handler.ts | |||
@@ -8,7 +8,7 @@ import { JobScheduler } from '../job-scheduler' | |||
8 | import { TranscodingJobPayload } from './transcoding-job-scheduler' | 8 | import { TranscodingJobPayload } from './transcoding-job-scheduler' |
9 | 9 | ||
10 | async function process (data: TranscodingJobPayload, jobId: number) { | 10 | async function process (data: TranscodingJobPayload, jobId: number) { |
11 | const video = await db.Video.loadByUUIDAndPopulateAccountAndPodAndTags(data.videoUUID) | 11 | const video = await db.Video.loadByUUIDAndPopulateAccountAndServerAndTags(data.videoUUID) |
12 | // No video, maybe deleted? | 12 | // No video, maybe deleted? |
13 | if (!video) { | 13 | if (!video) { |
14 | logger.info('Do not process job %d, video does not exist.', jobId, { videoUUID: video.uuid }) | 14 | logger.info('Do not process job %d, video does not exist.', jobId, { videoUUID: video.uuid }) |
@@ -31,7 +31,7 @@ async function onSuccess (jobId: number, video: VideoInstance, jobScheduler: Job | |||
31 | logger.info('Job %d is a success.', jobId) | 31 | logger.info('Job %d is a success.', jobId) |
32 | 32 | ||
33 | // Maybe the video changed in database, refresh it | 33 | // Maybe the video changed in database, refresh it |
34 | const videoDatabase = await db.Video.loadByUUIDAndPopulateAccountAndPodAndTags(video.uuid) | 34 | const videoDatabase = await db.Video.loadByUUIDAndPopulateAccountAndServerAndTags(video.uuid) |
35 | // Video does not exist anymore | 35 | // Video does not exist anymore |
36 | if (!videoDatabase) return undefined | 36 | if (!videoDatabase) return undefined |
37 | 37 | ||
diff --git a/server/lib/jobs/transcoding-job-scheduler/video-file-transcoder-handler.ts b/server/lib/jobs/transcoding-job-scheduler/video-file-transcoder-handler.ts index 77e5d9f7f..4f2ce3d24 100644 --- a/server/lib/jobs/transcoding-job-scheduler/video-file-transcoder-handler.ts +++ b/server/lib/jobs/transcoding-job-scheduler/video-file-transcoder-handler.ts | |||
@@ -5,7 +5,7 @@ import { VideoInstance } from '../../../models' | |||
5 | import { sendUpdateVideo } from '../../activitypub/send-request' | 5 | import { sendUpdateVideo } from '../../activitypub/send-request' |
6 | 6 | ||
7 | async function process (data: { videoUUID: string, resolution: VideoResolution }, jobId: number) { | 7 | async function process (data: { videoUUID: string, resolution: VideoResolution }, jobId: number) { |
8 | const video = await db.Video.loadByUUIDAndPopulateAccountAndPodAndTags(data.videoUUID) | 8 | const video = await db.Video.loadByUUIDAndPopulateAccountAndServerAndTags(data.videoUUID) |
9 | // No video, maybe deleted? | 9 | // No video, maybe deleted? |
10 | if (!video) { | 10 | if (!video) { |
11 | logger.info('Do not process job %d, video does not exist.', jobId, { videoUUID: video.uuid }) | 11 | logger.info('Do not process job %d, video does not exist.', jobId, { videoUUID: video.uuid }) |
@@ -28,7 +28,7 @@ async function onSuccess (jobId: number, video: VideoInstance) { | |||
28 | logger.info('Job %d is a success.', jobId) | 28 | logger.info('Job %d is a success.', jobId) |
29 | 29 | ||
30 | // Maybe the video changed in database, refresh it | 30 | // Maybe the video changed in database, refresh it |
31 | const videoDatabase = await db.Video.loadByUUIDAndPopulateAccountAndPodAndTags(video.uuid) | 31 | const videoDatabase = await db.Video.loadByUUIDAndPopulateAccountAndServerAndTags(video.uuid) |
32 | // Video does not exist anymore | 32 | // Video does not exist anymore |
33 | if (!videoDatabase) return undefined | 33 | if (!videoDatabase) return undefined |
34 | 34 | ||
diff --git a/server/lib/user.ts b/server/lib/user.ts index d2d599dfd..9884e566f 100644 --- a/server/lib/user.ts +++ b/server/lib/user.ts | |||
@@ -46,7 +46,7 @@ async function createLocalAccount (name: string, userId: number, applicationId: | |||
46 | followingUrl: url + '/following', | 46 | followingUrl: url + '/following', |
47 | userId, | 47 | userId, |
48 | applicationId, | 48 | applicationId, |
49 | podId: null // It is our pod | 49 | serverId: null // It is our server |
50 | }) | 50 | }) |
51 | 51 | ||
52 | return accountInstance.save({ transaction: t }) | 52 | return accountInstance.save({ transaction: t }) |
diff --git a/server/lib/video-channel.ts b/server/lib/video-channel.ts index 13841ea33..80303fb83 100644 --- a/server/lib/video-channel.ts +++ b/server/lib/video-channel.ts | |||
@@ -30,14 +30,14 @@ async function createVideoChannel (videoChannelInfo: VideoChannelCreate, account | |||
30 | return videoChannelCreated | 30 | return videoChannelCreated |
31 | } | 31 | } |
32 | 32 | ||
33 | async function fetchVideoChannelByHostAndUUID (podHost: string, uuid: string, t: Sequelize.Transaction) { | 33 | async function fetchVideoChannelByHostAndUUID (serverHost: string, uuid: string, t: Sequelize.Transaction) { |
34 | try { | 34 | try { |
35 | const videoChannel = await db.VideoChannel.loadByHostAndUUID(podHost, uuid, t) | 35 | const videoChannel = await db.VideoChannel.loadByHostAndUUID(serverHost, uuid, t) |
36 | if (!videoChannel) throw new Error('Video channel not found') | 36 | if (!videoChannel) throw new Error('Video channel not found') |
37 | 37 | ||
38 | return videoChannel | 38 | return videoChannel |
39 | } catch (err) { | 39 | } catch (err) { |
40 | logger.error('Cannot load video channel from host and uuid.', { error: err.stack, podHost, uuid }) | 40 | logger.error('Cannot load video channel from host and uuid.', { error: err.stack, serverHost, uuid }) |
41 | throw err | 41 | throw err |
42 | } | 42 | } |
43 | } | 43 | } |