Exemplo n.º 1
0
        public static int GetRecommendationScore(Resources.UserPoints points, Resources.Movie movie, IMovieDataRepository movieDataRepository, IReviewRepository reviewRepository)
        {
            int imdb    = movie.Imdb.GetValueOrDefault();
            int ms      = movie.MetaScore.GetValueOrDefault();
            int com     = ScoreHelper.GetMovieCommunityScore(movie.IdMovie.Value, reviewRepository);
            int platFav = 0;
            int pop     = ScoreHelper.GetMoviePopularity(movie.IdMovie.Value, movieDataRepository, reviewRepository);

            if (movie.PlatFav)
            {
                platFav = 100;
            }

            int score = (imdb * points.Imdb / 100) + (ms * points.MetaScore / 100) + (com * points.Community / 100) + (platFav * points.PlatFav / 100)
                        + (pop * points.Popularity / 100);

            return(score);
        }
Exemplo n.º 2
0
        public static int GetMoviePopularity(int idMovie, IMovieDataRepository movieDataRepository, IReviewRepository reviewRepository)
        {
            if (idMovie <= 0)
            {
                return(0);
            }

            int score = 0;

            if (ScoreHelper.isFromThisYear(idMovie, movieDataRepository))
            {
                score += 20;
            }
            if (ScoreHelper.isPlataformFavorite(idMovie, movieDataRepository))
            {
                score += 20;
            }
            score += ScoreHelper.reviewsScore(idMovie, reviewRepository);

            return(score);
        }