import { throwIfNotValid } from '../utils'
import { VideoModel } from './video'
import { isVideoCaptionLanguageValid } from '../../helpers/custom-validators/video-captions'
-import { VideoCaption } from '../../../shared/models/videos/video-caption.model'
+import { VideoCaption } from '../../../shared/models/videos/caption/video-caption.model'
import { CONFIG, STATIC_PATHS, VIDEO_LANGUAGES } from '../../initializers'
import { join } from 'path'
import { logger } from '../../helpers/logger'
-import { unlinkPromise } from '../../helpers/core-utils'
+import { remove } from 'fs-extra'
export enum ScopeNames {
WITH_VIDEO_UUID_AND_REMOTE = 'WITH_VIDEO_UUID_AND_REMOTE'
}
if (instance.isOwned()) {
- logger.debug('Removing captions %s of video %s.', instance.Video.uuid, instance.language)
+ logger.info('Removing captions %s of video %s.', instance.Video.uuid, instance.language)
try {
await instance.removeCaptionFile()
}
removeCaptionFile () {
- return unlinkPromise(CONFIG.STORAGE.CAPTIONS_DIR + this.getCaptionName())
+ return remove(CONFIG.STORAGE.CAPTIONS_DIR + this.getCaptionName())
}
}