don't bother trying to make app name configurable actually

main
xenofem 2022-04-27 00:44:35 -04:00
parent b84cb24ab9
commit c41430bcdc
2 changed files with 3 additions and 5 deletions

View File

@ -13,6 +13,8 @@ use actix_web::{
use actix_web_actors::ws;
use time::OffsetDateTime;
const APP_NAME: &'static str = "transbeam";
pub struct UploadedFile {
name: String,
size: usize,
@ -43,10 +45,6 @@ fn storage_dir() -> PathBuf {
PathBuf::from(std::env::var("STORAGE_DIR").unwrap_or_else(|_| String::from("storage")))
}
fn app_name() -> String {
std::env::var("APP_NAME").unwrap_or_else(|_| String::from("transbeam"))
}
#[get("/upload")]
async fn upload_socket(
req: HttpRequest,

View File

@ -167,7 +167,7 @@ impl Uploader {
let writer = super::zip::ZipGenerator::new(files, Box::new(writer));
let size = writer.total_size();
self.writer = Some(Box::new(writer));
let download_filename = super::app_name()
let download_filename = super::APP_NAME.to_owned()
+ &now.format(FILENAME_DATE_FORMAT)?
+ ".zip";
let modtime = now;