示例#1
0
        private async Task <string> GetSubFolderFromAction()
        {
            Coordinates coordinates = GetCoordinates();
            string      result      = null;

            if (coordinates != null && coordinates.IsValid())
            {
                OSMData osmData = await _geoService.GetOsmData(coordinates);

                result = GetValue(osmData);
            }
            return(result ?? await ActionHelpers.ExecuteWithAlternative(_model.Alternative, Config.UserConfig.ByCityDefaultText));
        }
        private async Task <string> GetSubFolderFromAction()
        {
            string createdTime = _model.MetadataService.GetKey(Config.UserConfig.MetadataDateTimeOriginal);

            if (string.IsNullOrEmpty(createdTime))
            {
                createdTime = _regexService.GetDateFromFileName(_model.File.Name);
                if (string.IsNullOrEmpty(createdTime))
                {
                    return(await ActionHelpers.ExecuteWithAlternative(_model.Alternative, Config.UserConfig.ByDateDefaultText));
                }
            }
            DateTime.TryParseExact(createdTime, Config.UserConfig.DateTimeToOrganizeImagesFormat, CultureInfo.CurrentCulture, DateTimeStyles.None, out DateTime dateTime);
            return(dateTime.ToString(_model.Type.Type));
        }