diff options
Diffstat (limited to 'server/controllers/api/videos')
-rw-r--r-- | server/controllers/api/videos/import.ts | 4 | ||||
-rw-r--r-- | server/controllers/api/videos/index.ts | 4 | ||||
-rw-r--r-- | server/controllers/api/videos/live.ts | 4 | ||||
-rw-r--r-- | server/controllers/api/videos/rate.ts | 6 |
4 files changed, 9 insertions, 9 deletions
diff --git a/server/controllers/api/videos/import.ts b/server/controllers/api/videos/import.ts index 5840cd063..bc5fea7aa 100644 --- a/server/controllers/api/videos/import.ts +++ b/server/controllers/api/videos/import.ts | |||
@@ -28,7 +28,7 @@ import { getYoutubeDLInfo, getYoutubeDLSubs, YoutubeDLInfo } from '../../../help | |||
28 | import { CONFIG } from '../../../initializers/config' | 28 | import { CONFIG } from '../../../initializers/config' |
29 | import { MIMETYPES } from '../../../initializers/constants' | 29 | import { MIMETYPES } from '../../../initializers/constants' |
30 | import { sequelizeTypescript } from '../../../initializers/database' | 30 | import { sequelizeTypescript } from '../../../initializers/database' |
31 | import { getVideoActivityPubUrl } from '../../../lib/activitypub/url' | 31 | import { getLocalVideoActivityPubUrl } from '../../../lib/activitypub/url' |
32 | import { JobQueue } from '../../../lib/job-queue/job-queue' | 32 | import { JobQueue } from '../../../lib/job-queue/job-queue' |
33 | import { createVideoMiniatureFromExisting, createVideoMiniatureFromUrl } from '../../../lib/thumbnail' | 33 | import { createVideoMiniatureFromExisting, createVideoMiniatureFromUrl } from '../../../lib/thumbnail' |
34 | import { autoBlacklistVideoIfNeeded } from '../../../lib/video-blacklist' | 34 | import { autoBlacklistVideoIfNeeded } from '../../../lib/video-blacklist' |
@@ -250,7 +250,7 @@ function buildVideo (channelId: number, body: VideoImportCreate, importData: You | |||
250 | originallyPublishedAt: body.originallyPublishedAt || importData.originallyPublishedAt | 250 | originallyPublishedAt: body.originallyPublishedAt || importData.originallyPublishedAt |
251 | } | 251 | } |
252 | const video = new VideoModel(videoData) | 252 | const video = new VideoModel(videoData) |
253 | video.url = getVideoActivityPubUrl(video) | 253 | video.url = getLocalVideoActivityPubUrl(video) |
254 | 254 | ||
255 | return video | 255 | return video |
256 | } | 256 | } |
diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts index bfebc54ed..b5ff2e72e 100644 --- a/server/controllers/api/videos/index.ts +++ b/server/controllers/api/videos/index.ts | |||
@@ -5,7 +5,7 @@ import toInt from 'validator/lib/toInt' | |||
5 | import { addOptimizeOrMergeAudioJob } from '@server/helpers/video' | 5 | import { addOptimizeOrMergeAudioJob } from '@server/helpers/video' |
6 | import { createTorrentAndSetInfoHash } from '@server/helpers/webtorrent' | 6 | import { createTorrentAndSetInfoHash } from '@server/helpers/webtorrent' |
7 | import { changeVideoChannelShare } from '@server/lib/activitypub/share' | 7 | import { changeVideoChannelShare } from '@server/lib/activitypub/share' |
8 | import { getVideoActivityPubUrl } from '@server/lib/activitypub/url' | 8 | import { getLocalVideoActivityPubUrl } from '@server/lib/activitypub/url' |
9 | import { LiveManager } from '@server/lib/live-manager' | 9 | import { LiveManager } from '@server/lib/live-manager' |
10 | import { buildLocalVideoFromReq, buildVideoThumbnailsFromReq, setVideoTags } from '@server/lib/video' | 10 | import { buildLocalVideoFromReq, buildVideoThumbnailsFromReq, setVideoTags } from '@server/lib/video' |
11 | import { getVideoFilePath } from '@server/lib/video-paths' | 11 | import { getVideoFilePath } from '@server/lib/video-paths' |
@@ -189,7 +189,7 @@ async function addVideo (req: express.Request, res: express.Response) { | |||
189 | videoData.duration = videoPhysicalFile['duration'] // duration was added by a previous middleware | 189 | videoData.duration = videoPhysicalFile['duration'] // duration was added by a previous middleware |
190 | 190 | ||
191 | const video = new VideoModel(videoData) as MVideoFullLight | 191 | const video = new VideoModel(videoData) as MVideoFullLight |
192 | video.url = getVideoActivityPubUrl(video) // We use the UUID, so set the URL after building the object | 192 | video.url = getLocalVideoActivityPubUrl(video) // We use the UUID, so set the URL after building the object |
193 | 193 | ||
194 | const videoFile = new VideoFileModel({ | 194 | const videoFile = new VideoFileModel({ |
195 | extname: extname(videoPhysicalFile.filename), | 195 | extname: extname(videoPhysicalFile.filename), |
diff --git a/server/controllers/api/videos/live.ts b/server/controllers/api/videos/live.ts index d438b6f3a..a6f00c1bd 100644 --- a/server/controllers/api/videos/live.ts +++ b/server/controllers/api/videos/live.ts | |||
@@ -3,7 +3,7 @@ import { v4 as uuidv4 } from 'uuid' | |||
3 | import { createReqFiles } from '@server/helpers/express-utils' | 3 | import { createReqFiles } from '@server/helpers/express-utils' |
4 | import { CONFIG } from '@server/initializers/config' | 4 | import { CONFIG } from '@server/initializers/config' |
5 | import { ASSETS_PATH, MIMETYPES } from '@server/initializers/constants' | 5 | import { ASSETS_PATH, MIMETYPES } from '@server/initializers/constants' |
6 | import { getVideoActivityPubUrl } from '@server/lib/activitypub/url' | 6 | import { getLocalVideoActivityPubUrl } from '@server/lib/activitypub/url' |
7 | import { federateVideoIfNeeded } from '@server/lib/activitypub/videos' | 7 | import { federateVideoIfNeeded } from '@server/lib/activitypub/videos' |
8 | import { Hooks } from '@server/lib/plugins/hooks' | 8 | import { Hooks } from '@server/lib/plugins/hooks' |
9 | import { buildLocalVideoFromReq, buildVideoThumbnailsFromReq, setVideoTags } from '@server/lib/video' | 9 | import { buildLocalVideoFromReq, buildVideoThumbnailsFromReq, setVideoTags } from '@server/lib/video' |
@@ -86,7 +86,7 @@ async function addLiveVideo (req: express.Request, res: express.Response) { | |||
86 | videoData.duration = 0 | 86 | videoData.duration = 0 |
87 | 87 | ||
88 | const video = new VideoModel(videoData) as MVideoDetails | 88 | const video = new VideoModel(videoData) as MVideoDetails |
89 | video.url = getVideoActivityPubUrl(video) // We use the UUID, so set the URL after building the object | 89 | video.url = getLocalVideoActivityPubUrl(video) // We use the UUID, so set the URL after building the object |
90 | 90 | ||
91 | const videoLive = new VideoLiveModel() | 91 | const videoLive = new VideoLiveModel() |
92 | videoLive.saveReplay = videoInfo.saveReplay || false | 92 | videoLive.saveReplay = videoInfo.saveReplay || false |
diff --git a/server/controllers/api/videos/rate.ts b/server/controllers/api/videos/rate.ts index 3ee365289..df1eddb4f 100644 --- a/server/controllers/api/videos/rate.ts +++ b/server/controllers/api/videos/rate.ts | |||
@@ -2,7 +2,7 @@ import * as express from 'express' | |||
2 | import { UserVideoRateUpdate } from '../../../../shared' | 2 | import { UserVideoRateUpdate } from '../../../../shared' |
3 | import { logger } from '../../../helpers/logger' | 3 | import { logger } from '../../../helpers/logger' |
4 | import { VIDEO_RATE_TYPES } from '../../../initializers/constants' | 4 | import { VIDEO_RATE_TYPES } from '../../../initializers/constants' |
5 | import { getRateUrl, sendVideoRateChange } from '../../../lib/activitypub/video-rates' | 5 | import { getLocalRateUrl, sendVideoRateChange } from '../../../lib/activitypub/video-rates' |
6 | import { asyncMiddleware, asyncRetryTransactionMiddleware, authenticate, videoUpdateRateValidator } from '../../../middlewares' | 6 | import { asyncMiddleware, asyncRetryTransactionMiddleware, authenticate, videoUpdateRateValidator } from '../../../middlewares' |
7 | import { AccountModel } from '../../../models/account/account' | 7 | import { AccountModel } from '../../../models/account/account' |
8 | import { AccountVideoRateModel } from '../../../models/account/account-video-rate' | 8 | import { AccountVideoRateModel } from '../../../models/account/account-video-rate' |
@@ -52,7 +52,7 @@ async function rateVideo (req: express.Request, res: express.Response) { | |||
52 | await previousRate.destroy(sequelizeOptions) | 52 | await previousRate.destroy(sequelizeOptions) |
53 | } else { // Update previous rate | 53 | } else { // Update previous rate |
54 | previousRate.type = rateType | 54 | previousRate.type = rateType |
55 | previousRate.url = getRateUrl(rateType, userAccount.Actor, videoInstance) | 55 | previousRate.url = getLocalRateUrl(rateType, userAccount.Actor, videoInstance) |
56 | await previousRate.save(sequelizeOptions) | 56 | await previousRate.save(sequelizeOptions) |
57 | } | 57 | } |
58 | } else if (rateType !== 'none') { // There was not a previous rate, insert a new one if there is a rate | 58 | } else if (rateType !== 'none') { // There was not a previous rate, insert a new one if there is a rate |
@@ -60,7 +60,7 @@ async function rateVideo (req: express.Request, res: express.Response) { | |||
60 | accountId: accountInstance.id, | 60 | accountId: accountInstance.id, |
61 | videoId: videoInstance.id, | 61 | videoId: videoInstance.id, |
62 | type: rateType, | 62 | type: rateType, |
63 | url: getRateUrl(rateType, userAccount.Actor, videoInstance) | 63 | url: getLocalRateUrl(rateType, userAccount.Actor, videoInstance) |
64 | } | 64 | } |
65 | 65 | ||
66 | await AccountVideoRateModel.create(query, sequelizeOptions) | 66 | await AccountVideoRateModel.create(query, sequelizeOptions) |