aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/video.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/video/video.ts')
-rw-r--r--server/models/video/video.ts9
1 files changed, 4 insertions, 5 deletions
diff --git a/server/models/video/video.ts b/server/models/video/video.ts
index f84a90992..7e3512fe1 100644
--- a/server/models/video/video.ts
+++ b/server/models/video/video.ts
@@ -143,7 +143,7 @@ import {
143import { MVideoFile, MVideoFileStreamingPlaylistVideo } from '../../typings/models/video/video-file' 143import { MVideoFile, MVideoFileStreamingPlaylistVideo } from '../../typings/models/video/video-file'
144import { MThumbnail } from '../../typings/models/video/thumbnail' 144import { MThumbnail } from '../../typings/models/video/thumbnail'
145import { VideoFile } from '@shared/models/videos/video-file.model' 145import { VideoFile } from '@shared/models/videos/video-file.model'
146import { getTorrentFileName, getTorrentFilePath, getVideoFilename, getVideoFilePath } from '@server/lib/video-paths' 146import { getTorrentFileName, getTorrentFilePath, getVideoFilename, getVideoFilePath, getHLSDirectory } from '@server/lib/video-paths'
147 147
148// FIXME: Define indexes here because there is an issue with TS and Sequelize.literal when called directly in the annotation 148// FIXME: Define indexes here because there is an issue with TS and Sequelize.literal when called directly in the annotation
149const indexes: (ModelIndexesOptions & { where?: WhereOptions })[] = [ 149const indexes: (ModelIndexesOptions & { where?: WhereOptions })[] = [
@@ -1950,11 +1950,10 @@ export class VideoModel extends Model<VideoModel> {
1950 } 1950 }
1951 1951
1952 removeStreamingPlaylist (isRedundancy = false) { 1952 removeStreamingPlaylist (isRedundancy = false) {
1953 const baseDir = isRedundancy ? HLS_REDUNDANCY_DIRECTORY : HLS_STREAMING_PLAYLIST_DIRECTORY 1953 const directoryPath = getHLSDirectory(this, isRedundancy)
1954 1954
1955 const filePath = join(baseDir, this.uuid) 1955 return remove(directoryPath)
1956 return remove(filePath) 1956 .catch(err => logger.warn('Cannot delete playlist directory %s.', directoryPath, { err }))
1957 .catch(err => logger.warn('Cannot delete playlist directory %s.', filePath, { err }))
1958 } 1957 }
1959 1958
1960 isOutdated () { 1959 isOutdated () {