[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:
parent
e34b4f5c1a
commit
3e8ba289c3
1 changed files with 6 additions and 0 deletions
|
@ -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(),
|
||||
|
|
Loading…
Add table
Reference in a new issue