diff options
author | Chocobozzz <me@florianbigard.com> | 2019-08-20 19:05:31 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-08-20 19:23:10 +0200 |
commit | 1ca9f7c3f7afac2af4c4c25b98426731f7e789c6 (patch) | |
tree | 27fe65c4ea5e9250d2523033d5c65b315bfca23d /server/models/video/video-caption.ts | |
parent | 0283eaac2a8e73006c66df3cf5bb9012e37450e5 (diff) | |
download | PeerTube-1ca9f7c3f7afac2af4c4c25b98426731f7e789c6.tar.gz PeerTube-1ca9f7c3f7afac2af4c4c25b98426731f7e789c6.tar.zst PeerTube-1ca9f7c3f7afac2af4c4c25b98426731f7e789c6.zip |
Type toFormattedJSON
Diffstat (limited to 'server/models/video/video-caption.ts')
-rw-r--r-- | server/models/video/video-caption.ts | 10 |
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' | |||
22 | import { remove } from 'fs-extra' | 22 | import { remove } from 'fs-extra' |
23 | import { CONFIG } from '../../initializers/config' | 23 | import { CONFIG } from '../../initializers/config' |
24 | import * as Bluebird from 'bluebird' | 24 | import * as Bluebird from 'bluebird' |
25 | import { MVideoCaptionVideo } from '@server/typings/models' | 25 | import { MVideoCaptionFormattable, MVideoCaptionVideo } from '@server/typings/models' |
26 | 26 | ||
27 | export enum ScopeNames { | 27 | export 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 | } |