refactor
Some checks failed
ci/woodpecker/push/build Pipeline failed

This commit is contained in:
JMARyA 2024-12-29 21:39:54 +01:00
parent bcb0d8738a
commit 198994a99c
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
5 changed files with 24 additions and 16 deletions

View file

@ -22,7 +22,11 @@ pub async fn video_file(v: &str, library: &State<Library>) -> Option<DataRespons
"video/webm"
};
return Some(DataResponse::new(buf, content_type, Some(60 * 60 * 24 * 3)));
return Some(DataResponse::new(
buf,
content_type.to_string(),
Some(60 * 60 * 24 * 3),
));
}
None
@ -37,7 +41,11 @@ pub async fn video_thumbnail(v: &str, library: &State<Library>) -> Option<DataRe
};
if let Some(data) = library.get_thumbnail(&video).await {
return Some(DataResponse::new(data, "image/png", Some(60 * 60 * 24 * 3)));
return Some(DataResponse::new(
data,
"image/png".to_string(),
Some(60 * 60 * 24 * 3),
));
}
None
@ -47,7 +55,7 @@ pub async fn video_thumbnail(v: &str, library: &State<Library>) -> Option<DataRe
pub async fn fav_icon() -> DataResponse {
DataResponse::new(
include_bytes!("../../src/icon.png").to_vec(),
"image/png",
"image/png".to_string(),
Some(60 * 60 * 24 * 30),
)
}