From 66fb2aa39b6f8e4677f80128c27fbafd3a8fe2e7 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 21 Nov 2019 12:16:27 +0100 Subject: Don't always replace actor avatar --- server/models/video/video.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'server/models/video/video.ts') 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 { import { MVideoFile, MVideoFileStreamingPlaylistVideo } from '../../typings/models/video/video-file' import { MThumbnail } from '../../typings/models/video/thumbnail' import { VideoFile } from '@shared/models/videos/video-file.model' -import { getTorrentFileName, getTorrentFilePath, getVideoFilename, getVideoFilePath } from '@server/lib/video-paths' +import { getTorrentFileName, getTorrentFilePath, getVideoFilename, getVideoFilePath, getHLSDirectory } from '@server/lib/video-paths' // FIXME: Define indexes here because there is an issue with TS and Sequelize.literal when called directly in the annotation const indexes: (ModelIndexesOptions & { where?: WhereOptions })[] = [ @@ -1950,11 +1950,10 @@ export class VideoModel extends Model { } removeStreamingPlaylist (isRedundancy = false) { - const baseDir = isRedundancy ? HLS_REDUNDANCY_DIRECTORY : HLS_STREAMING_PLAYLIST_DIRECTORY + const directoryPath = getHLSDirectory(this, isRedundancy) - const filePath = join(baseDir, this.uuid) - return remove(filePath) - .catch(err => logger.warn('Cannot delete playlist directory %s.', filePath, { err })) + return remove(directoryPath) + .catch(err => logger.warn('Cannot delete playlist directory %s.', directoryPath, { err })) } isOutdated () { -- cgit v1.2.3