1
0
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:
NG (Graham)
2025-06-01 17:51:12 -04:00
parent 297a2ab246
commit 6ddea92a87
14 changed files with 495 additions and 7 deletions

View File

@@ -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
}
}