Exemplo n.º 1
0
        private async Task <SoftwareData> GetSoftwareAsync(SoftwareCameraInfo camera, SoftwareInfo softwareInfo, CancellationToken cancellationToken)
        {
            SetTitle(nameof(Resources.Download_FetchingData_Text));

            var buildName = BuildProvider.GetBuildName(softwareInfo);
            var matches   = await MatchProvider.GetMatchesAsync(camera, buildName, cancellationToken);

            if (matches == null)
            {
                var error = MatchProvider.GetError();
                SetTitle(error, LogLevel.Error);
                return(null);
            }

            var match     = matches.Last();
            var info      = SoftwareProvider.GetSoftware(match);
            var downloads = DownloadProvider.GetDownloads(matches, info).ToArray();

            return(new SoftwareData
            {
                Info = info,
                Downloads = downloads,
            });
        }