Пример #1
0
        private void FillInPage(People human)
        {
            var bioInfo = new ProfileInfo(human.Id);

            Info      = bioInfo.GetInfo();
            ImageLink = new Uri(Info.ProfilePath);

            Movies = bioInfo.GetHistory();

            var topList    = BuildBarDiagram();
            var circleList = BuildCircleDiagram();

            BarChart.Entries    = topList;
            CircleChart.Entries = circleList;
        }
Пример #2
0
        private async Task <double> Prediction(MovieShort movie)
        {
            var credits     = new CastAndCrew(movie.Id);
            var castList    = credits.GetCredits();
            var countToTake = castList.Cast.Count > _maxCounter ? _maxCounter : castList.Cast.Count;
            var rateAvg     = 0D;

            return(await Task.Run(() =>
            {
                foreach (var cast in castList.Cast.Take(countToTake))
                {
                    var person = new ProfileInfo(cast.Id);
                    var resume = person.GetHistory();
                    rateAvg += resume.Cast.Select(i => i.VoteAverage).Average();
                }

                rateAvg = rateAvg / countToTake;

                return Math.Round(rateAvg, 2);
            }));
        }