From 6939cbac48e0a9823b34577836480ae3c28186be Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 25 Jan 2021 11:33:26 +0100 Subject: Safely remove webtorrent files Only remove them on max quality HLS playlist generation --- server/models/video/video.ts | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'server/models') diff --git a/server/models/video/video.ts b/server/models/video/video.ts index 720bfd829..343abde44 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts @@ -1804,6 +1804,10 @@ export class VideoModel extends Model { return Object.assign(file, { Video: this }) } + hasWebTorrentFiles () { + return Array.isArray(this.VideoFiles) === true && this.VideoFiles.length !== 0 + } + async addAndSaveThumbnail (thumbnail: MThumbnail, transaction: Transaction) { thumbnail.videoId = this.id -- cgit v1.2.3