1
0
mirror of https://git.ngram.ca/OpenJam/rc-servers synced 2026-08-23 23:08:52 +00:00

Add arc thumbnail support as part of #10

This commit is contained in:
NG (Graham)
2025-05-24 23:56:48 -04:00
parent 59612e6aa3
commit 2607903f7b
13 changed files with 310 additions and 20 deletions

View File

@@ -1,8 +1,8 @@
use actix_web::{dev::ResourcePath, get, web::{Data, Path}, Responder};
use actix_web::{get, web::{Data, Path}, Responder};
#[get("/customavatar/Live/{name}")]
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.path()));
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
}