From 71dd103deae43ab1bb7149492c08db740daed87c Mon Sep 17 00:00:00 2001 From: rootdarkarchon Date: Sat, 13 Jan 2024 10:28:17 +0100 Subject: [PATCH] fix bug --- .../Controllers/ServerFilesController.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MareSynchronosServer/MareSynchronosStaticFilesServer/Controllers/ServerFilesController.cs b/MareSynchronosServer/MareSynchronosStaticFilesServer/Controllers/ServerFilesController.cs index 94b4b68..bbef50a 100644 --- a/MareSynchronosServer/MareSynchronosStaticFilesServer/Controllers/ServerFilesController.cs +++ b/MareSynchronosServer/MareSynchronosStaticFilesServer/Controllers/ServerFilesController.cs @@ -97,7 +97,9 @@ public class ServerFilesController : ControllerBase if (!selectedShards.Any()) selectedShards = matchingShards; } - var shard = selectedShards.OrderBy(g => Guid.NewGuid()).FirstOrDefault(); + var shard = selectedShards + .OrderBy(s => s.Continents.Contains("*", StringComparer.Ordinal) ? 0 : 1) + .ThenBy(g => Guid.NewGuid()).FirstOrDefault(); var baseUrl = shard?.CdnFullUrl ?? _configuration.GetValue(nameof(StaticFilesServerConfiguration.CdnFullUrl));