[backend/drive] Fix incorrect mime type & file extension when converting original files (ISH-593)

Closes #64

Co-authored-by: Tamara Schmitz <tamara.zoe.schmitz@posteo.de>
This commit is contained in:
Laura Hausmann 2024-11-07 19:51:34 +01:00
parent e34b4f5c1a
commit 3e8ba289c3
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -312,6 +312,12 @@ public class DriveService(
throw new Exception("Uri must not be null at this stage");
}
if (original?.format.Format is { } fmt and not ImageFormat.Keep)
{
request.MimeType = fmt.MimeType;
request.Filename += $".{fmt.Extension}";
}
file = new DriveFile
{
Id = IdHelpers.GenerateSnowflakeId(),