public void CalculateProgress() { _updateForm.CalculateProgress(); var progress = _updateForm.ImageDownloadProgress .Where(p => !Str.Equals(p.QualityGroup.Quality, "Art")) .ToArray(); var countTotal = progress .Sum(_ => _.FilesOnline?.Count ?? 0); var countDownloaded = progress .Where(_ => _.FilesOnline != null) .Sum(_ => _.FilesDownloaded.Count); var notDownloaded = countTotal - countDownloaded; NeedToSuggestDownloader = notDownloaded > 0 && _config.Enabled != false; ProgressCalculated?.Invoke(); }
public void CalculateProgress() { _formUpdate.CalculateProgress(); var progress = _formUpdate.ImageDownloadProgress .Where(p => !Str.Equals(p.QualityGroup.Quality, "Art")) .ToArray(); var countTotal = progress .Sum(_ => _.FilesOnline?.Count ?? 0); var countDownloaded = progress .Where(_ => _.FilesOnline != null) .Sum(_ => _.FilesDownloaded.Count); var notDownloaded = countTotal - countDownloaded; NeedToSuggestDownloader = notDownloaded > 0 && _uiConfigRepository.Config.SuggestDownloadMissingImages; ProgressCalculated?.Invoke(); }