From d1b0f9528c535c1dbbacd3c388765fc322833ba8 Mon Sep 17 00:00:00 2001 From: Debug <49997488+DebugOk@users.noreply.github.com> Date: Sun, 24 Dec 2023 23:07:08 +0100 Subject: [PATCH] Hm yes, surely hardcoding is a great idea --- SS14.MapServer/Controllers/MapController.cs | 31 ++++++++++++++++++--- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/SS14.MapServer/Controllers/MapController.cs b/SS14.MapServer/Controllers/MapController.cs index 40d4df0..9f9a757 100644 --- a/SS14.MapServer/Controllers/MapController.cs +++ b/SS14.MapServer/Controllers/MapController.cs @@ -199,10 +199,7 @@ public async Task DeleteMap(string id, string gitRef) [Consumes("application/json")] public async Task SyncMaps(string? mapFileNames, bool syncAll) { - // Split the string into a list of strings. They're seperated by commas. - if (mapFileNames == null) - mapFileNames = ""; - var mapList = mapFileNames.Split(',').ToList(); + var mapList = mapFileNames?.Split(',').ToImmutableList() ?? ImmutableList.Empty; var data = new JobDataMap { @@ -228,6 +225,32 @@ public async Task SyncAllMaps() return Ok(); } + [HttpPost("syncalldelta")] + [Consumes("application/json")] + public async Task SyncAllDelta() + { + // Hardcoded go brr + var mapList = new List + { + "arena.yml", + "asterisk.yml", + "edge.yml", + "hive.yml", + "pebble.yml", + "shoukou.yml", + "tortuga.yml" + }; + + var data = new JobDataMap + { + {Jobs.SyncMaps.MapListKey, mapList}, + {Jobs.SyncMaps.SyncAllKey, false} + }; + + await _schedulingService.RunJob(nameof(Jobs.SyncMaps), "Sync", data); + return Ok(); + } + private bool ValidateMapRequest(Map map, ICollection images, [NotNullWhen(true)] out BadRequestObjectResult? error) { //Ensure map id is lowercase