mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
Add default image to CDN, favicon to registration, create logo
This commit is contained in:
@@ -4,5 +4,10 @@ use actix_web::{get, web::{Data, Path}, Responder};
|
||||
pub async fn get(cli: Data<crate::cli::CliArgs>, name: Path<String>) -> impl Responder {
|
||||
let path = std::path::PathBuf::from(&cli.data_robocraft).join("customavatars").join(format!("{}.jpg", *name));
|
||||
log::debug!("RC asset at {} (exists? {})", path.display(), path.exists());
|
||||
actix_files::NamedFile::open_async(path).await
|
||||
if path.exists() {
|
||||
actix_files::NamedFile::open_async(path).await
|
||||
} else {
|
||||
log::info!("Not found /customavatar/Live/{} -> {}, using default image", name, path.display());
|
||||
actix_files::NamedFile::open_async(std::path::PathBuf::from(&cli.assets_robocraft).join(super::DEFAULT_IMAGE)).await
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user