From 1ca9f7c3f7afac2af4c4c25b98426731f7e789c6 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 20 Aug 2019 19:05:31 +0200 Subject: Type toFormattedJSON --- server/models/video/video-caption.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'server/models/video/video-caption.ts') 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' import { remove } from 'fs-extra' import { CONFIG } from '../../initializers/config' import * as Bluebird from 'bluebird' -import { MVideoCaptionVideo } from '@server/typings/models' +import { MVideoCaptionFormattable, MVideoCaptionVideo } from '@server/typings/models' export enum ScopeNames { WITH_VIDEO_UUID_AND_REMOTE = 'WITH_VIDEO_UUID_AND_REMOTE' @@ -154,7 +154,7 @@ export class VideoCaptionModel extends Model { return this.Video.remote === false } - toFormattedJSON (): VideoCaption { + toFormattedJSON (this: MVideoCaptionFormattable): VideoCaption { return { language: { id: this.language, @@ -164,15 +164,15 @@ export class VideoCaptionModel extends Model { } } - getCaptionStaticPath () { + getCaptionStaticPath (this: MVideoCaptionFormattable) { return join(LAZY_STATIC_PATHS.VIDEO_CAPTIONS, this.getCaptionName()) } - getCaptionName () { + getCaptionName (this: MVideoCaptionFormattable) { return `${this.Video.uuid}-${this.language}.vtt` } - removeCaptionFile () { + removeCaptionFile (this: MVideoCaptionFormattable) { return remove(CONFIG.STORAGE.CAPTIONS_DIR + this.getCaptionName()) } } -- cgit v1.2.3