public static async Task TryUpdateMissingLocationInfoAsync()

in LocationHelper/LocationHelper.cs [256:280]


        public static async Task<bool> TryUpdateMissingLocationInfoAsync(LocationData location, LocationData currentLocation)
        {
            bool hasNoAddress = String.IsNullOrEmpty(location.Address);
            if (hasNoAddress && location.Position.Latitude == 0 && location.Position.Longitude == 0) return true;

            var results = hasNoAddress ?
                await MapLocationFinder.FindLocationsAtAsync(location.Geopoint) :
                await MapLocationFinder.FindLocationsAsync(location.Address, currentLocation.Geopoint);

            if (results.Status == MapLocationFinderStatus.Success && results.Locations.Count > 0)
            {
                var result = results.Locations.First();
                location.Position = result.Point.Position;
                location.Address = result.Address.FormattedAddress;
                if (String.IsNullOrEmpty(location.Name)) location.Name = result.Address.Town;

                // Sometimes the returned address is poorly formatted. This fixes one of the issues.
                if (location.Address.Trim().StartsWith(",")) location.Address = location.Address.Trim().Substring(1).Trim();
                return true;
            }
            else
            {
                return false;
            }
        }