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

This commit is contained in:
JMARyA 2024-12-15 00:31:39 +01:00
parent 09beb0bcc2
commit bb61c16429
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
5 changed files with 108 additions and 60 deletions

View file

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