private async static void OnCreated(object source, FileSystemEventArgs e) { Logger.LogTrace($"New Image was {e.ChangeType}: {e.FullPath}"); try { var harvest = recognizerService.Recognize($"{_dataFolder}/{e.Name}").Result; var blobUrl = string.Empty; var shortenedUrl = string.Empty; blobUrl = await storageService.Upload(string.IsNullOrEmpty(harvest.Specie)? "unknown" : harvest.Specie.Replace(" ", "_"), $"{ _dataFolder}/{e.Name}"); Logger.LogDebug(blobUrl); if (!string.IsNullOrWhiteSpace(blobUrl)) { shortenedUrl = await shortenerService.DoShort(blobUrl); Logger.LogInfo(shortenedUrl); harvest.ImageUrl = shortenedUrl; } harvest.SourceImage = e.Name; _session.AddHarvest(harvest); Logger.LogWarn($"{e.Name} - {(harvest.IsValid ? harvest.ToString() : "")} - {blobUrl} - {shortenedUrl}"); ascendingOrder = _session.SortByHarvestTime(); DisplayHarvests($"Sorting by Harvest Time {(ascendingOrder ? "Ascending" : "Descending")}..."); } catch (Exception ex) { Logger.LogError(ex); } }