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

@ -27,7 +27,7 @@ async fn launch() -> _ {
let lib = library::Library::new().await;
User::create("admin", "admin", based::auth::UserRole::Admin).await;
User::create("admin".to_string(), "admin", based::auth::UserRole::Admin).await;
let library = lib.clone();

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),
)
}

View file

@ -60,7 +60,7 @@ pub async fn watch_page(
};
};
div id="recommendations" class="mt-8" {
div id="recommendations" class="mt-8 w-1/3" {
h3 class="text-center text-4xl font-extrabold leading-tight mb-2" { "In " a class="text-blue-500" href=(format!("/d/{}", video.directory)) { (video.directory) }; }
@for video in library.get_directory_videos(&video.directory).await {
(video_element_wide(&video).await);