Add unknown to save file download if game doesn't exist. Add .zip file extension

save-path-regex
Pat Hartl 2023-11-30 17:31:40 -06:00
parent ce80dfa51f
commit eb73885991
1 changed files with 1 additions and 1 deletions

View File

@ -30,7 +30,7 @@ namespace LANCommander.Controllers
if (!System.IO.File.Exists(filename)) if (!System.IO.File.Exists(filename))
return NotFound(); return NotFound();
return File(new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read), "application/zip", $"{save.User?.UserName} - {save.Game?.Title} - {save.CreatedOn.ToString("MM-dd-yyyy.hh-mm")}"); return File(new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read), "application/zip", $"{save.User?.UserName} - {(save.Game == null ? "Unknown" : save.Game?.Title)} - {save.CreatedOn.ToString("MM-dd-yyyy.hh-mm")}.zip");
} }
} }
} }