Have Media db return optional content_type, conversion fixes

This commit is contained in:
Devin Ragotzy 2020-11-18 08:36:12 -05:00 committed by Timo Kösters
parent bb24f6ad90
commit b6d721374f
No known key found for this signature in database
GPG key ID: 24DA7517711A2BA4
5 changed files with 47 additions and 31 deletions

View file

@ -66,7 +66,7 @@ pub async fn get_content_route(
{
Ok(get_content::Response {
file,
content_type: Some(content_type),
content_type,
content_disposition: filename,
}
.into())
@ -116,11 +116,7 @@ pub async fn get_content_thumbnail_route(
.try_into()
.map_err(|_| Error::BadRequest(ErrorKind::InvalidParam, "Width is invalid."))?,
)? {
Ok(get_content_thumbnail::Response {
file,
content_type: Some(content_type),
}
.into())
Ok(get_content_thumbnail::Response { file, content_type }.into())
} else if &*body.server_name != db.globals.server_name() && body.allow_remote {
let get_thumbnail_response = server_server::send_request(
&db.globals,