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.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/server/models/video/video-caption.ts b/server/models/video/video-caption.ts
index 9ce350d12..ad5801768 100644
--- a/server/models/video/video-caption.ts
+++ b/server/models/video/video-caption.ts
@@ -22,7 +22,7 @@ import { logger } from '../../helpers/logger'
22import { remove } from 'fs-extra' 22import { remove } from 'fs-extra'
23import { CONFIG } from '../../initializers/config' 23import { CONFIG } from '../../initializers/config'
24import * as Bluebird from 'bluebird' 24import * as Bluebird from 'bluebird'
25import { MVideoCaptionVideo } from '@server/typings/models' 25import { MVideoCaptionFormattable, MVideoCaptionVideo } from '@server/typings/models'
26 26
27export enum ScopeNames { 27export enum ScopeNames {
28 WITH_VIDEO_UUID_AND_REMOTE = 'WITH_VIDEO_UUID_AND_REMOTE' 28 WITH_VIDEO_UUID_AND_REMOTE = 'WITH_VIDEO_UUID_AND_REMOTE'
@@ -154,7 +154,7 @@ export class VideoCaptionModel extends Model<VideoCaptionModel> {
154 return this.Video.remote === false 154 return this.Video.remote === false
155 } 155 }
156 156
157 toFormattedJSON (): VideoCaption { 157 toFormattedJSON (this: MVideoCaptionFormattable): VideoCaption {
158 return { 158 return {
159 language: { 159 language: {
160 id: this.language, 160 id: this.language,
@@ -164,15 +164,15 @@ export class VideoCaptionModel extends Model<VideoCaptionModel> {
164 } 164 }
165 } 165 }
166 166
167 getCaptionStaticPath () { 167 getCaptionStaticPath (this: MVideoCaptionFormattable) {
168 return join(LAZY_STATIC_PATHS.VIDEO_CAPTIONS, this.getCaptionName()) 168 return join(LAZY_STATIC_PATHS.VIDEO_CAPTIONS, this.getCaptionName())
169 } 169 }
170 170
171 getCaptionName () { 171 getCaptionName (this: MVideoCaptionFormattable) {
172 return `${this.Video.uuid}-${this.language}.vtt` 172 return `${this.Video.uuid}-${this.language}.vtt`
173 } 173 }
174 174
175 removeCaptionFile () { 175 removeCaptionFile (this: MVideoCaptionFormattable) {
176 return remove(CONFIG.STORAGE.CAPTIONS_DIR + this.getCaptionName()) 176 return remove(CONFIG.STORAGE.CAPTIONS_DIR + this.getCaptionName())
177 } 177 }
178} 178}