The public projection of a server's place showed only the country for servers reporting fewer than 10 users. The owner never decided that threshold: every located server now shows its city, coordinates (0.1°) and network, and a CDN-fronted one still shows only its CDN, since the address reached is the CDN's edge. Statistics:PublicCityMinUsers is gone; the ROADMAP decision on server locations, CLAUDE.md and the /stargazing explainer are corrected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LsXgEaXee4GCU1hwYgPJXw
23 lines
861 B
C#
23 lines
861 B
C#
using PrivaPub.Models.Jobs;
|
|
|
|
namespace PrivaPub.Domain.Statistics
|
|
{
|
|
public sealed record PublicLocation(string Country, string City, double? Latitude, double? Longitude, string Network, string Cdn);
|
|
|
|
public static class PublicGeo
|
|
{
|
|
//a server's place as it is shown publicly: where it was located (country, city, coordinates to 0.1°, network),
|
|
//except that a CDN-fronted server shows only its CDN, because the address we reached is the CDN's edge
|
|
public static PublicLocation Project(InstanceGeo geo)
|
|
{
|
|
if (geo == default)
|
|
return default;
|
|
if (geo.Cdn != default)
|
|
return new PublicLocation(default, default, default, default, default, geo.Cdn);
|
|
if (geo.Country == default && geo.Latitude == default)
|
|
return default;
|
|
return new PublicLocation(geo.Country, geo.City, geo.Latitude, geo.Longitude, geo.AsnOrg, default);
|
|
}
|
|
}
|
|
}
|