This commit is contained in:
rootdarkarchon
2024-01-13 10:28:17 +01:00
parent 53e96d9318
commit 71dd103dea

View File

@@ -97,7 +97,9 @@ public class ServerFilesController : ControllerBase
if (!selectedShards.Any()) selectedShards = matchingShards; 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<Uri>(nameof(StaticFilesServerConfiguration.CdnFullUrl)); var baseUrl = shard?.CdnFullUrl ?? _configuration.GetValue<Uri>(nameof(StaticFilesServerConfiguration.CdnFullUrl));