parent
bcb0d8738a
commit
198994a99c
5 changed files with 24 additions and 16 deletions
|
@ -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();
|
||||
|
||||
|
|
|
@ -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),
|
||||
)
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue