From 6302d599cdf98b5a5363a2a1dcdc266447950191 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 15 Feb 2021 14:08:16 +0100 Subject: Generate a name for caption files --- server/lib/thumbnail.ts | 3 +++ 1 file changed, 3 insertions(+) (limited to 'server/lib/thumbnail.ts') diff --git a/server/lib/thumbnail.ts b/server/lib/thumbnail.ts index 740b83acb..33aa7159c 100644 --- a/server/lib/thumbnail.ts +++ b/server/lib/thumbnail.ts @@ -166,6 +166,9 @@ async function createThumbnailFromFunction (parameters: { }) { const { thumbnailCreator, filename, width, height, type, existingThumbnail, automaticallyGenerated = null, fileUrl = null } = parameters + // Remove old file + if (existingThumbnail) await existingThumbnail.removeThumbnail() + const thumbnail = existingThumbnail || new ThumbnailModel() thumbnail.filename = filename -- cgit v1.2.3