From eb73885991fa1ca02518e5ddc0ca34ff200c9a74 Mon Sep 17 00:00:00 2001 From: Pat Hartl Date: Thu, 30 Nov 2023 17:31:40 -0600 Subject: [PATCH] Add unknown to save file download if game doesn't exist. Add .zip file extension --- LANCommander/Controllers/SavesController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LANCommander/Controllers/SavesController.cs b/LANCommander/Controllers/SavesController.cs index 1b0780e..e4317df 100644 --- a/LANCommander/Controllers/SavesController.cs +++ b/LANCommander/Controllers/SavesController.cs @@ -30,7 +30,7 @@ namespace LANCommander.Controllers if (!System.IO.File.Exists(filename)) 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"); } } }