parent
09beb0bcc2
commit
bb61c16429
5 changed files with 108 additions and 60 deletions
|
@ -1,4 +1,9 @@
|
|||
use rocket::{fs::NamedFile, get, State};
|
||||
use rocket::{
|
||||
fs::NamedFile,
|
||||
get,
|
||||
http::{ContentType, Status},
|
||||
State,
|
||||
};
|
||||
|
||||
use crate::library::Library;
|
||||
|
||||
|
@ -29,3 +34,11 @@ pub async fn video_thumbnail(v: &str, library: &State<Library>) -> Option<NamedF
|
|||
|
||||
NamedFile::open(format!("{thumbnail_path}.jpg")).await.ok()
|
||||
}
|
||||
|
||||
#[get("/favicon")]
|
||||
pub async fn fav_icon() -> (Status, (ContentType, &'static [u8])) {
|
||||
(
|
||||
Status::Ok,
|
||||
(ContentType::PNG, include_bytes!("../../src/icon.png")),
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue