private async Task Generate(VersionGenerator generator) { activity = $"Generating " + generator.VersionTypeName; max = _metadataStore.CountFilesMissingAttributeVersion(generator.VersionTypeName); var files = _metadataStore.FilesMissingAttributeVersion(generator.VersionTypeName); processed = 0; foreach (var file in files) { try { Stream content = _metadataStore.GetFileStream(file.Id); var thumbnailValue = generator.GenerateVersion(content); await _metadataStore.AddVersion(file.Id, generator.VersionTypeName, thumbnailValue); processed++; } catch (Exception ex) { } } }