Files
ojrc/cdn/src/robocraft/user_avatar.rs
T

8 lines
425 B
Rust
Raw Normal View History

2025-05-24 23:56:48 -04:00
use actix_web::{get, web::{Data, Path}, Responder};
2025-05-24 16:21:45 -04:00
#[get("/customavatar/Live/{name}")]
pub async fn get(cli: Data<crate::cli::CliArgs>, name: Path<String>) -> impl Responder {
2025-05-24 23:56:48 -04:00
let path = std::path::PathBuf::from(&cli.data_robocraft).join("customavatars").join(format!("{}.jpg", *name));
2025-05-24 16:21:45 -04:00
log::debug!("RC asset at {} (exists? {})", path.display(), path.exists());
actix_files::NamedFile::open_async(path).await
}