aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/video-caption.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/video/video-caption.ts')
-rw-r--r--server/models/video/video-caption.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/models/video/video-caption.ts b/server/models/video/video-caption.ts
index a1553ea15..71b067335 100644
--- a/server/models/video/video-caption.ts
+++ b/server/models/video/video-caption.ts
@@ -15,8 +15,9 @@ import {
15 Table, 15 Table,
16 UpdatedAt 16 UpdatedAt
17} from 'sequelize-typescript' 17} from 'sequelize-typescript'
18import { v4 as uuidv4 } from 'uuid'
18import { buildRemoteVideoBaseUrl } from '@server/helpers/activitypub' 19import { buildRemoteVideoBaseUrl } from '@server/helpers/activitypub'
19import { MVideoAccountLight, MVideoCaption, MVideoCaptionFormattable, MVideoCaptionVideo } from '@server/types/models' 20import { MVideoCaption, MVideoCaptionFormattable, MVideoCaptionVideo, MVideoWithHost } from '@server/types/models'
20import { VideoCaption } from '../../../shared/models/videos/caption/video-caption.model' 21import { VideoCaption } from '../../../shared/models/videos/caption/video-caption.model'
21import { isVideoCaptionLanguageValid } from '../../helpers/custom-validators/video-captions' 22import { isVideoCaptionLanguageValid } from '../../helpers/custom-validators/video-captions'
22import { logger } from '../../helpers/logger' 23import { logger } from '../../helpers/logger'
@@ -24,7 +25,6 @@ import { CONFIG } from '../../initializers/config'
24import { CONSTRAINTS_FIELDS, LAZY_STATIC_PATHS, VIDEO_LANGUAGES, WEBSERVER } from '../../initializers/constants' 25import { CONSTRAINTS_FIELDS, LAZY_STATIC_PATHS, VIDEO_LANGUAGES, WEBSERVER } from '../../initializers/constants'
25import { buildWhereIdOrUUID, throwIfNotValid } from '../utils' 26import { buildWhereIdOrUUID, throwIfNotValid } from '../utils'
26import { VideoModel } from './video' 27import { VideoModel } from './video'
27import { v4 as uuidv4 } from 'uuid'
28 28
29export enum ScopeNames { 29export enum ScopeNames {
30 WITH_VIDEO_UUID_AND_REMOTE = 'WITH_VIDEO_UUID_AND_REMOTE' 30 WITH_VIDEO_UUID_AND_REMOTE = 'WITH_VIDEO_UUID_AND_REMOTE'
@@ -204,7 +204,7 @@ export class VideoCaptionModel extends Model {
204 return remove(CONFIG.STORAGE.CAPTIONS_DIR + this.filename) 204 return remove(CONFIG.STORAGE.CAPTIONS_DIR + this.filename)
205 } 205 }
206 206
207 getFileUrl (video: MVideoAccountLight) { 207 getFileUrl (video: MVideoWithHost) {
208 if (!this.Video) this.Video = video as VideoModel 208 if (!this.Video) this.Video = video as VideoModel
209 209
210 if (video.isOwned()) return WEBSERVER.URL + this.getCaptionStaticPath() 210 if (video.isOwned()) return WEBSERVER.URL + this.getCaptionStaticPath()