Skip to content
This repository has been archived by the owner on Apr 20, 2024. It is now read-only.

Commit

Permalink
Hm yes, surely hardcoding is a great idea
Browse files Browse the repository at this point in the history
  • Loading branch information
DebugOk committed Dec 24, 2023
1 parent 4df6a2a commit d1b0f95
Showing 1 changed file with 27 additions and 4 deletions.
31 changes: 27 additions & 4 deletions SS14.MapServer/Controllers/MapController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,7 @@ public async Task<IActionResult> DeleteMap(string id, string gitRef)
[Consumes("application/json")]
public async Task<IActionResult> 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<string>.Empty;

var data = new JobDataMap
{
Expand All @@ -228,6 +225,32 @@ public async Task<IActionResult> SyncAllMaps()
return Ok();
}

[HttpPost("syncalldelta")]
[Consumes("application/json")]
public async Task<IActionResult> SyncAllDelta()
{
// Hardcoded go brr
var mapList = new List<string>
{
"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<Jobs.SyncMaps>(nameof(Jobs.SyncMaps), "Sync", data);
return Ok();
}

private bool ValidateMapRequest(Map map, ICollection<IFormFile> images, [NotNullWhen(true)] out BadRequestObjectResult? error)
{
//Ensure map id is lowercase
Expand Down

0 comments on commit d1b0f95

Please sign in to comment.